4 ms·
Yes and no, An important caveat that Dart as JavaScript runs in it's own isolate and communicates with existing JavaScript libs through ports. This js-interop c
by michaelwww 13y ago
Yes and no, An important caveat that Dart as JavaScript runs in it's own isolate and communicates with existing JavaScript libs through ports. This js-interop code is nearly 500k unminified. And you won't be able to minify all your JS (dartJs + other js) into one lib, because dart js doesn't play well with standard tools. One can certainly interop with js libs, but it's not pretty. Dart is not near 1.0 yet, so there is still time for improvement, but this doesn't seem to be a priority. Dart is great, don't get me wrong, and I've been working with it for several months, but I think this point should be made in fairness. You're really going to want to go all in with Dart and leave your custom js libs behind or convert them to Dart. If you have the luxury of working with just Dart code, then you'll be in for a pleasant surprise at how productive you can be and how fast the Dart VM is.
- xxgreg 13y agoYeah - it would be nice if dart2js supported externs as in the closure compiler. I imagine that will happen at some stage.
- michaelwww 13y agoYes, I think so too. The question about the need for an isolate has been asked by a Google's own Dart evangelist, so it's on their minds at least. Notice there wasn't much of a response. It's not a hot issue, but I think it will be. https://groups.google.com/a/dartlang.org/forum/#!topic/compiler-dev/Vl6e_ccC7w4 https://groups.google.com/a/dartlang.org/forum/#!topic/compi... TypeScript is good that you can transition gradually. I've been using it for the past week and it almost feels like working with Dart with the advantage that's it's just JavaScript. TypeScript interfaces to hundreds of JavaScript libs and jQuery plugins have already been written. I imagine I'll settle on Dart for some things and TypeScript for others and maybe eventually get them working together.
- camus 13y agoOn the opposite side , with a little bit of "header" writing ( or none but you lose type safety ) , Haxe support direct use of javascript libraries , that's what makes Haxe better than dart in my opinion, and you can reuse all the code that is not tied to the DOM is C++,Neko,Java and Flash apps (and android + iphone + ... with the NME framework ). But Dart optional type system is still interesting.
- michaelwww 13y agoOptional typing is the neatest thing since sliced bread. I wouldn't want to go back to a language that didn't offer a choice.