4 ms·
Dart is not "intended to compile to Javascript". Dart is intended to compete with Javascript. Compiling to Javascript is just intended as a fallback.
by beza1e1 15y ago
Dart is not "intended to compile to Javascript". Dart is intended to compete with Javascript. Compiling to Javascript is just intended as a fallback.
- firefoxman1 15y agoThis has probably been asked before, but why haven't any browsers worked on natively implementing CoffeeScript (not compiling to Javascript first)?
- gcp 15y agoBecause there is no advantage to that at all? Dart has more type information, so a Dart compiler has some hints to generate faster code. (And this is why fast JavaScript engines do type inference)
- firefoxman1 15y agoWell, I mean, if you're going to try to change the web's language, why not use a well-thought-out and already widely-used language? Are there so many flaws in CoffeeScript that Google needed to write yet another language?
- kibwen 15y agoIt would be a lot of work for very little benefit, given that CS already compiles to Javascript with very little (or none, or negative) overhead. However, in Firefox at least, there are some tentative plans to make debugging transpiled Javascript easier by adding support for identifying the location of the runtime errors in the original source file[1]. I haven't checked, but perhaps there exist addons to allow Firefox's Javascript console to execute CS natively. Other than these two features, I'm not sure what more you could ask for regarding browser support. [1] https://wiki.mozilla.org/DevTools/Features/SourceMap https://wiki.mozilla.org/DevTools/Features/SourceMap
- kibwen 15y agoThis is true, and I should have chosen my words better. My intended point, however, was that unless Google is attempting to deliberately sabotage the performance of Javascript-compiled Dart applications, there are practical limits to what they can achieve via translation (or so I assume, correct me if this is misguided).
- spankalee 15y agoI think you're wrong here. Being able to compile to Javascript with good performance is a primary design goal. Of course, there's no reason a language can't both compete with and compile to Javascript, like CoffeeScript for example.