3 ms·
This is a really interesting idea. I'm surprised this is the first language I've heard of that targets C. C's major strength is portability, but that means chan
by zaius 11y ago
This is a really interesting idea. I'm surprised this is the first language I've heard of that targets C. C's major strength is portability, but that means change is slow. When browsers stagnated, coffeescript filled the void, which in turn influenced new versions of javascript.
A certain subset of C++ seems to solve a lot of peoples' problems with C, but it also seems there's no consensus on what that subset is. So people stick with C because at least the rules are defined. Compile-to-C languages like this could have all the benefit of switching to C++ without the downsides
- ziotom78 11y agoIt is indeed an interesting idea. However, it is hardly the first to do this. The first C++ compiler (cfront) did so [1], and there are other languages that follow this idea still today [2][3]. [1] https://en.wikipedia.org/wiki/Cfront https://en.wikipedia.org/wiki/Cfront [2] http://chapel.cray.com/ http://chapel.cray.com/ [3] http://nim-lang.org/ http://nim-lang.org/
- jrapdx3 11y agoNot a new idea at all, many compilers for different languages output C as one option anyway[0]. Among languages I've enjoyed using and achieving high productivity is CHICKEN Scheme[1]. The compiler defaults to emitting C, though usually the C code is immediately compiled into binary object or executable form. CHICKEN also integrates very well with C as embedded in a C application, using C libraries or writing C directly in "foreign-lambda*" expressions. [0] http://stackoverflow.com/questions/6498850/programming-languages-that-compile-into-c-c-source http://stackoverflow.com/questions/6498850/programming-langu... [1] http://call-cc.org http://call-cc.org
- agumonkey 11y agoSince you mention CHICKEN, the "Lisp in small pieces" book although describe such a procedure.
- chipsy 11y agoI'm feeling a lot more interested in OOC now than the last time I looked, not because the language changed but because I did. I've tried everything else that's popular in the domain at this point and overwhelmingly, the problem is that new systems languages are too big, too incompatible with the existing ecosystem, or too immature in their tooling. They are usable, and many of their cares and concerns are justifiable, but they're overwhelming in a lot of ways. The compilers do so much, and they break, they have weird error messages, or do surprising things with their advanced features. They're mainly built by people who want to make great compiler technology - and they have that, but that doesn't necessarily lead to a smooth development experience on my end. Most of those issues are sidestepped with a smaller language that just encodes a bunch of common idioms, which OOC does. There are other viable "compile to C" languages out there, of course, but I'm getting more interested in this one. Edit: And yeah, this is the Go argument. But Go doesn't want to be C-like, really.
- Gracana 11y agoVala is another example of such a language. It generates C and uses GObject under the hood. https://wiki.gnome.org/Projects/Vala https://wiki.gnome.org/Projects/Vala
- deleted 11y ago[deleted]
- Cyph0n 11y agoNim is one relatively popular language that compiles down to C [1]. Jonathan Blow's upcoming language Jai is another one. [1]: http://nim-lang.org http://nim-lang.org