JavaScript

Google Releases Stable Dart Version, JavaScript Rival

After more than a year of work, Google finally released the first stable version of Dart, the scripting language it hopes will take the place of JavaScript. Though the search giant also unveiled plenty of other goodies to go along with Dart, the company faces an uphill battle for the language's adoption.

After more than a year of work, Google finally released the first stable version of Dart, the scripting language it hopes will take the place of JavaScript. Though the search giant also unveiled plenty of other goodies to go along with Dart, the company faces an uphill battle for the language's adoption.

What kind of inducements does Google offer for those interested in creating web-based applications in Dart? For starters, there's Dartium, a Chromium-based browser that includes the Dart virtual machine (DVM). Programmers can use it to test Dart web applications directly, without compiling to JavaScript until they need to test them on other browsers. Keep in mind that Dartium is a technical preview, and users are warned right at the top of the download page not to use Dartium as their primary browser.

So what do you do when you're ready to run your Dart app on a browser without a DVM? The Dart project also offers the Dart2JS compiler to take care of this issue. It lets users convert Dart software into JavaScript so browser that don't boast a DVM can run it. And if you're not sure how to start writing that Dart app you've been dreaming of, you can check out some pre-built code. Let's not forget the Dart editor that Google and the Dart project thoughtfully provide.

This stable version of Dart makes some serious improvements on previous versions. The language's developers paid attention to copious feedback and “plow[ed] through thousands of bug reports and feature requests from the web community,” according to Lars Bak, a software engineer working on the project. For example, he noted that the Dart Virtual Machine now outperforms even V8, the JavaScript engine in Chrome, on some Octane tests. Octane is a browser benchmark for JavaScript created by Google and released back in August.

With JavaScript's long history and ubiquitous usage, Dart needs to be able to interact with it. One new addition to Dart is the js.dart library that “allows Dart code running in the browser to manipulate JavaScript running in the same page.” In this way, Dart code can interact with third-party JavaScript libraries.

If you're interested in rolling up your sleeves and seeing what you can do with Dart, you may want to check out the new language specification. Those of you who have already used Dart to one degree or another and just want to see what's been added will want to look at the language changes. But some of you might be wondering why you should use Dart, when JavaScript still dominates and neither Microsoft nor Mozilla care to support it?

I don't have a good answer to that – and unless Google does, Dart may die a quick death. In Google's opinion, however, JavaScript is broken to the point that continuing fixes, such as those employed through the EcmaScript standards process, won't save it. And never mind projects like CoffeeScript that let developers create their apps in a more polished language before converting it back into JavaScript! Apparently we need something better, according to Google, and Dart is it.

Still, Dart has its supporters, such as Mike Eberhart, who notes that it might become his primary development language. “I am absolutely thrilled with the productivity improvements I am seeing when developing with Dart (instead of JavaScript)!” he wrote in his blog. He believes the language's real potential lies in business applications, “where the browser-choice can be 100% guaranteed to include Chrome (if it remains the only browser to include Dart support).” If Dart makes developing such applications more efficient and less costly, and is as easy for JavaScript developers to learn as Eberhart claims, he may have a point. At the very least, Google makes it easy for you to find out for yourself.

DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.