Dart - a few wildly speculative thoughts

Colin's post on Dart and the other fallout from Google's announcement across the web sparked a few thoughts in my mind, so I thought I'd share them.

Firstly I think it's important to point out how much of what is currently being said is speculative. Most people's opinions on Dart are covered with disclaimers especially this one from Brendan Eich and this one is going to be no different :)

Colin made the point that Google might be onto a loser if they don't support jQuery, which he felt was unlikely to happen/be possible. I'd personally be very surprised if Dart didn't support jQuery, probably through some form of "native" interface. My guess is it'll be implemented in a similar way to the way Closure-Compiler. You supply an extern file which defines the jQuery methods annotated in the Closure convention. Once you have the extern file you can then reference the functions defined in it from Closure annotated code with full type checking etc..

Speaking of Closure, I think it's a shame Google hasn't thrown some money behind improving the tooling support for it. It's approach of sticking to a subset of JavaScript and using JsDoc annotations for type information does work well. The two downsides of it are the lack of IDE support, which renders all the annotations very labourius to add and edit, and the initial steep learning curve to get it all setup. Both of these issues are solvable with tooling but it would seem there isn't the desire from Google to do that.

I think long term, Google's stop gap measure of compiling down to JavaScript could well become /the/ way to use Dart. It would still have the advantage of working "as is" in Chrome, so you'd get the developer tools with decent debugging, DOM inspection and profilers while you were developing. Then when you're finished you'd compile down for the other browsers. This approach would very much depend on the readability of the compiled JavaScript, because no one wants to try and debug an IE specific bug in unreadable code! Again maybe Closure and GWTs approach of multiple compilation types is how this will end up being implemented, or I've heard of work within the various browser's developer tools to support source maps so maybe that's an alternative.

I'd like to end with Brendan Eich's parting comment from the link above -

Since the '60s, researchers have dreamed of universal object files (ANDF, e.g.). It would be too funny if far-future JS merges into this single standard too!("too funny" in my experience means this will definitely happen...)/be

MORE BY CHRIS

Efficient SVG layout with d3

blog comments powered by Disqus