Friday, February 3, 2012

Towards a single Dart to JavaScript compiler


Posted by Kasper Lund

As some of you have already noticed, we've started making it easier to use our new Dart-to-JavaScript compiler backend implemented in Dart ("frog") from within the Dart Editor. This is the first step towards
replacing our first generation backend with a new shiny and improved implementation. We expect to complete the transition within a few weeks after which we'll be back to having only one way of compiling
Dart to JavaScript.

The new Dart-to-JavaScript compiler backend uses tree shaking to cut down on the generated code size and we're working on using an SSA-based intermediate representation to allow us to use classical
optimizations such as local type inferencing, loop-invariant code motion, and function inlining. The compiler runs on top of the Dart VM and makes use of the new server-side libraries such as dart:io. It is really nice to see things coming together this way!

As always your feedback on what works well and what doesn't is really important to us, so I hope you'll continue to file bugs and speak your mind on our mailing lists.