Enabling developers to run Dart code natively in the browser

Feb 17, 2012 13:04 GMT  ·  By

Google has been working on the Dart programming language for quite some time now. However, it only recently started offering more info and actual implementation details. Even so, while developers could experiment with Dart there were still hurdles, not the least of which the fact that no browser supported it natively.

That has finally changed, as Google has made available binaries for Dartium, a Chromium version with an integrated Dart Virtual Machine.

This means that Dart code can run natively in the browser, eliminating the need for a JavaScript compiler.

Dartium has been available to Googlers internally, but it is now being made available to all developers. But don't think of Dartium as a new browser, it's not designed to replace your current one, it's solely for testing Dart code.

"We’re making Mac and Linux binaries available that integrate the Dart VM into Chromium," Google announced.

"This technology preview allows you to run your Dart programs directly on the Dart VM in Chromium and avoid a separate compilation step. Over time, these programs will take advantage of the VM’s faster performance and lower startup latency," it said.

There are some big drawbacks to using Dartium. For one, it's only available for Mac OS X and Linux, though a Windows version is coming. It also "expires" every few days so you have to download a new binary to continue to use it.

That's one way of ensuring that users stay up to date and that only developers that truly need it will use it, but it may not be the best one.

Google has big plans for Dart and sees it as a replacement for JavaScript, though it won't really call it that for obvious reasons. Eventually, with the VM, Dart should offer better performance than JavaScript and the language itself is better suited for modern apps and websites.

That said, Google plans to continue to support the JavaScript compiler for Dart which will enable developers to target all browsers even though they write their apps in Dart.

"Dart has been designed from the start to work with the entire modern web, and we’re simultaneously continuing to improve our fast Dart-to-JavaScript compiler. Both the Dart VM and modern JavaScript engines are first-class targets for Dart," Google added.