Timeline for When does it make sense to compile my own language to C code first?
Current License: CC BY-SA 3.0
32 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Sep 13 at 21:12 | history | protected | gnat | ||
| Jun 15, 2018 at 10:20 | comment | added | Thorbjørn Ravn Andersen | Also note that C was designed as portable assembly languages on the many different architectures back then. Today you can do with x86_64 (and ARM and x86 if you really want) | |
| Jun 15, 2018 at 10:17 | comment | added | Thorbjørn Ravn Andersen | Note that javascript is being established as the new common tongue due to it being the assembly language of browsers. It may make sense to consider Javascript as a backend too. | |
| Dec 29, 2017 at 17:47 | comment | added | Chris | Here is the updated link from @RobertHarvey's comment: yosefk.com/blog/c-as-an-intermediate-language.html. | |
| Apr 20, 2015 at 17:27 | answer | added | supercat | timeline score: 2 | |
| Oct 10, 2014 at 19:42 | audit | Close votes | |||
| Oct 10, 2014 at 19:43 | |||||
| Oct 10, 2014 at 18:23 | audit | Reopen votes | |||
| Oct 11, 2014 at 19:08 | |||||
| Oct 7, 2014 at 21:30 | audit | Close votes | |||
| Oct 7, 2014 at 21:30 | |||||
| Oct 3, 2014 at 17:45 | comment | added | Basile Starynkevitch | I am not sure at all. I believe that compiling to C could be simpler for an object-oriented extension of C. BTW, you should write some blog entry, or some public document -perhaps on github, describing your current ideas (even if you did not start coding your translator) I'm sure you'll get interesting comments and feedback. | |
| Oct 3, 2014 at 12:14 | comment | added | danijar | @BasileStarynkevitch My intend is not to add complicated language features, but to simplify the syntax to make it more useful for prototyping. Therefore, I think compiling to C++ is the better choice for this specific requirement. Moreover, I get all the features like classes, templates and more on top. | |
| Oct 3, 2014 at 0:11 | answer | added | Carson63000 | timeline score: 1 | |
| Oct 2, 2014 at 21:50 | history | tweeted | twitter.com/#!/StackProgrammer/status/517793664869740545 | ||
| Oct 2, 2014 at 17:49 | comment | added | Basile Starynkevitch | But think about garbage collection (or the lack of it) before starting to code! | |
| Oct 2, 2014 at 17:32 | comment | added | Basile Starynkevitch | If you want to make a C++ like language, better emit C code (than C++ code). And there have been many attempts doing that (recently, Vala). | |
| Oct 2, 2014 at 17:27 | vote | accept | danijar | ||
| Oct 2, 2014 at 17:27 | comment | added | danijar | @BasileStarynkevitch It's not that I think of it as more as a learning project. However, I'll make it open source of course. | |
| Oct 2, 2014 at 17:26 | comment | added | danijar | @SK-logic Basically I want to simplify the syntax of C++. So it won't be interpreted, but compilation time is still a concern. | |
| Oct 2, 2014 at 17:21 | comment | added | Basile Starynkevitch | Look at several free software implementations generating C code. And I hope you'll make your language implementation free software. | |
| Oct 2, 2014 at 16:46 | comment | added | SK-logic | It makes sense when your language semantics maps to C easily (e.g., you do not require a runtime with preemptive green threads, like Erlang), when you do not care about compilation latency (e.g., this is not a scripting or protocol language), and when you can trust C level to optimise your code (e.g., no need to hint backend any further). | |
| Oct 2, 2014 at 16:29 | answer | added | Basile Starynkevitch | timeline score: 70 | |
| Oct 2, 2014 at 16:25 | comment | added | gbjbaanb | @emodendroket Microsoft is using their C++ compiler backend to compile C# IL into machine code themselves now. The OP would be advised to skip the middleman. | |
| Oct 2, 2014 at 16:17 | answer | added | gbjbaanb | timeline score: 9 | |
| Oct 2, 2014 at 16:16 | comment | added | danijar | @Tom It would be for learning purpose mainly and I haven't decided at all yet. I would try to simplify C++ syntax to be similar to Python while preserving all the compile time features. | |
| Oct 2, 2014 at 16:16 | comment | added | Casey | @delnan Well, it's not really clear from the OP which thing it's "about," but, sure, there are various reasons you might pick one or the other to be your intermediate language once you decide you want one. | |
| Oct 2, 2014 at 16:08 | comment | added | user7043 | @emodendroket However, C# and Java compile to an IL that is designed to be an IL in general and for C#/Java specifically, so in many ways CIL and JVM bytecode are more sensible and convenient as an IL than C could ever be. It's not about whether to use any intermediate language, it's about which intermediate language to use. | |
| Oct 2, 2014 at 16:00 | comment | added | Casey | If you look past C you'll see that C# and Java also both compile to intermediate languages. You're saved from having to redo a lot of work that someone else has already done by targeting an intermediate language instead of going straight to assembly. | |
| Oct 2, 2014 at 15:54 | answer | added | Tayyab Gulsher Vohra | timeline score: -7 | |
| Oct 2, 2014 at 15:54 | comment | added | toniedzwiedz | What's your use case? Why do you want to create a programming language of your own in the first place? What makes existing languages insufficient or sub-optimal for the task? | |
| Oct 2, 2014 at 15:49 | comment | added | Robert Harvey | yosefk.com/blog/c-as-an-intermediate-language.htmlv | |
| Oct 2, 2014 at 15:48 | comment | added | danijar | @RobertHarvey Let me reframe the question slightly. When does it make sense? | |
| Oct 2, 2014 at 15:48 | comment | added | Robert Harvey | What do you mean by "does it make sense?" Yes, this approach is sometimes used. | |
| Oct 2, 2014 at 15:46 | history | asked | danijar | CC BY-SA 3.0 |