4 ms·
> CoffeeScript does compile into JS, but so does Dart. Both are in that sense just syntactic sugar. With regards to Dart, that's like saying C++ is just syntac
by Xcelerate 14y ago
> CoffeeScript does compile into JS, but so does Dart. Both are in that sense just syntactic sugar.
With regards to Dart, that's like saying C++ is just syntactic sugar for assembly. When there's semantic differences between the mapping from one programming domain to another, I would argue that constitutes "compilation". I would agree with the statement for CoffeeScript though.
- batgaijin 14y agoI don't understand, are you saying Dart doesn't compile to JS?
- benmanns 14y agoDart does compile to JS while CoffeeScript retains a one-to-one mapping between CoffeeScript and JavaScript. Read the "golden rule."[0] [0]: http://coffeescript.org/ http://coffeescript.org/
- azakai 14y agoThis is a matter of degree. Dart's types do not affect runtime behavior (at least in the compiled-JS route), so basic types are quite close to JavaScript's, much like CoffeeScript. There are also no features in Dart that cannot be compiled into JS, like say threading with shared state. So overall I think it is reasonable to say that both Dart and CoffeeScript are close to JavaScript and built specifically to compile into it.
- skybrian 14y agoFor the most part it's designed to be easy to compile to JavaScript, but there are bizarre exceptions like support for arbitrary precision integers. (I believe this is ignored by the Dart to JS compiler.)
- sethladd 14y agoThis is true, and a known bug: http://code.google.com/p/dart/issues/detail?id=1533 http://code.google.com/p/dart/issues/detail?id=1533