Google gets on Dart soapbox, demos move from JavaScript

Developer talks up the process of moving a JavaScript audio app to Dart, touts user list and upgrades as Google pushes its JavaScript alternative

Can Google's Dart language ever really mount a serious challenge to the already-ubiquitous JavaScript in the realm of Web application development? Despite what seems like an insurmountable lead for JavaScript, Google is forging ahead.

Google continues to map out its Dart landscape, with a recent blog post purporting to show the benefits of porting from JavaScript to Dart, outlining continued enhancements to Dart, and touting a list of prominent users. In his blog post, Seth Ladd, a Web engineer and Chrome developer advocate at Google, detailed how he moved a JavaScript audio app to Dart. "It wasn't really difficult. We sort of designed Dart to be approachable," Ladd said.

But some analysts have doubts about how successful Dart can be. "Dart needs to cross-compile to JavaScript and was created to deal with deficiencies in JavaScript," said analyst Michael Azoff, of Ovum. "The question is whether JavaScript can evolve to fill the gap that Dart fills. Dart would need multivendor support to truly displace JavaScript. Its role may be more along [the lines of] influencing developments in adjacent languages like JavaScript, or whatever does displace JavaScript -- something will in time, no doubt."

With capabilities such as type annotations and libraries, Dart offers advantages over JavaScript, according to Ladd. "I discovered a bug in the original app because [JavaScript] doesn't have some of the developer feedback that Dart has," he said.

The original JavaScript app, which was 397 lines, was pruned down to 309 lines in Dart. "There's slightly less ceremony," when using Dart to write applications or for defining structures such as methods or functions, Ladd said. Dart actually compiles to JavaScript, so the generated output works in other browsers besides Google's Chrome, Ladd said. In his blog, he also stresses interoperability. "You can interoperate with JavaScript from Dart, it's just not a 'cut and paste' job."

In comments attached to his blog, Ladd mostly gets support for his efforts, although commenter Brian Sturgill was not convinced. "Sorry, Seth, but I'm really not impressed. The dart2js --minified output of your app is 151,013 bytes, the JavaScript you are replacing was only 12,515 bytes (NOT minified). If you had used TypeScript instead, it wouldn't have any overhead and it would still have revealed the bug you found."

Nonetheless, Google points to wins such as AngularDart, bringing the popular AngularJS avaScript framework to Dart, and JetBrains WebStorm JavaScript IDE, which supports Dart. The company also continues to regularly update Dart since  launching the 1.0 version last November; the current version is 1.3 and release 1.4 is due soon, Ladd said. The latter will feature tweaks, performance enhancements, and a featured called the observatory. "It's an app build into the Dart VM that gives developers deep insight into the performance of their apps," he said.  Developers will also be able to look at memory usage and optimize their applications.

This story, "Google gets on Dart soapbox, demos move from JavaScript," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Related:

Copyright © 2014 IDG Communications, Inc.