4 ms·
Good points. To clarify, by "suboptimal" I meant that the Javascript code generated by transpiling a Dart application will almost certainly be less optimal than
by kibwen 15y ago
Good points. To clarify, by "suboptimal" I meant that the Javascript code generated by transpiling a Dart application will almost certainly be less optimal than writing that application in Javascript from the outset. But, again, whether this will be an issue remains to be seen.
If there does turn out to be significant overhead to the transpilation phase, I'm curious if a pragmatic subset of Dart will emerge that avoids any language features that incur expensive tranformation costs, sort of like how some modern Python projects (e.g. Django) handle 2to3 compatibility by avoiding language features that are incompatible across versions to achieve a more unified codebase[1].
[1] http://groups.google.com/group/django-developers/browse_thread/thread/abede3685ad0302 http://groups.google.com/group/django-developers/browse_thre...
- spankalee 15y agoTo clarify, by "suboptimal" I meant that the Javascript code generated by transpiling a Dart application will almost certainly be less optimal than writing that application in Javascript from the outset. My point is that this is not really true. The Dart language itself is designed to compile to efficient Javascript. This is one reason it's a better solution than GWT in my opinion, because Java does not always compile to efficient Javascript and you do have to skip features like longs, Java regexes, even the java.util collections classes are heavyweight. Dart being designed from the start to compile to Javascript avoids most of these problems. Like CoffeeScript, I expect Dart performance to be very close to Javascript when compiled, sometimes even faster than what a programmer would normally write.