Google: Dart will rescue browsers from JavaScript

The programming language for Web sites and Web apps is less complex and therefore easier to develop, Chrome programmers argue at Google I/O.

Chrome programmer Lars Bak speaking at Google I/O 2013
Chrome programmer Lars Bak speaking at Google I/O 2013 Stephen Shankland/CNET

SAN FRANCISCO -- Google long has been a firm believer that JavaScript, the programming language used to build Web apps such as Google Maps and Gmail, could shoulder a much heavier computing load.

But even as the company continues to push JavaScript's abilities with Chrome's V8 engine, some at the company believe JavaScript is pushing up against its limits. For that reason, Google developed its Dart programming language, and at the Google I/O developer show here, the company made the case for Dart.

"The ultimate goal is to get Dart into Chrome. I hope you all agree," said Lars Bak, a Google programmer who has worked on both V8 and Dart, in a Google I/O talk on Thursday.

But Microsoft and Mozilla, which make the other two of the top three browsers, don't care for Dart, and when Bak tried to drum up support for Dart in Chrome, the Google I/O audience rewarded him with only a single, somewhat plaintive "Woo hoo!"

In the eyes of Bak and Kasper Lund, his coworker of 13 years, the basic problem is that JavaScript engines are already terrifically complex. Google's V8 has grown from 100,000 lines of code to 500,000 lines, and speeding JavaScript performance further is very difficult because of that complexity.

"We question whether it's possible to get a factor of two [speedup] in V8 in the near term," Bak said.

Dart has outpaced JavaScript on one benchmark Google monitors closely.
Dart has outpaced JavaScript on one benchmark Google monitors closely. Stephen Shankland/CNET

In contrast, Dart has surpassed JavaScript performance on two significant benchmarks -- Richards and DeltaBlue -- and has more room for growth, Bak said.

One example they showed of superior Dart performance was in a test that showed a group of animated monsters shown on the browser screen. Dart, unlike anyone's JavaScript engine at present, supports a processor technology called SIMD (single instruction, multiple data) that economizes chip work by doing the same work on multiple data elements. In contrast, JavaScript today needs a separate instruction for each element of data, even when the instructions are identical.

Dart with no SIMD could show 34 monsters with a 60-frame-per-second animation rate, but Dart with SIMD could handle 125 monsters at 60fps.
Google's V8 engine for running JavaScript programs in Chrome is getting steadily more complex, a big problem for speeding up code, Google's Lars Bak said at Google I/O.
Google's V8 engine for running JavaScript programs in Chrome is getting steadily more complex, a big problem for speeding up code, Google's Lars Bak said at Google I/O. Stephen Shankland/CNET

Google also argues that Dart is faster to program in and that developers concerned about its absence in other browsers can use the dart2js tool, which converts Dart software into JavaScript that any browser will run.

Google is developing Dart in a separate, experimental version of Chromium called Dartium. And Google has found an ally in Adobe Systems, which has released a tool that lets Flash programmers create Dart software.

Not everyone at Google believes it's time to write off JavaScript, and indeed Bak and Lund described work to make it faster. JavaScript is a permanent part of the Web today, and it won't go away.

Kasper Lund speaks at Google I/O 2013
Kasper Lund speaks at Google I/O 2013 Stephen Shankland/CNET

One hesitation about adopting Dart is that it will add another "runtime" to the Web -- another programming foundation that all browsers will have to support for as long as there is a Web. New runtimes add new complexity, software bloat, and attack surface.

Another issue is that JavaScript is a standard, developed with input from many interested parties. Although Dart is an open-source project, and Google actively solicits feedback, it's still a Google project.

Lund and Bak of course think it's all worthwhile, because Web developers have responded to JavaScript's recent speed improvements in all browsers with more sophisticated, dynamic, interactive sites and apps. For example, Amazon's Web page has 600KB of JavaScript code, ESPN has 900KB, and CNN has 1.5MB.

"Web developers are really pushing the limits of the platform," Lund said.

Updated 2:06 p.m. May 17 to correct how long Lund and Bak have been working together. It's 13 years.

Dart's support for SIMD (single instruction, multiple data) processing allows for a big performance boost. Without SIMD, this animation simulation can show 34 monsters with acceptable performance, but with SIMD, it jumps to 124.
Dart's support for SIMD (single instruction, multiple data) processing allows for a big performance boost. Without SIMD, this animation simulation can show 34 monsters with acceptable performance, but with SIMD, it jumps to 124. Stephen Shankland/CNET
 

ARTICLE DISCUSSION

Conversation powered by Livefyre

Don't Miss
Hot Products
Trending on CNET

Hot on CNET

The Next Big Thing

Consoles go wide and far beyond gaming with power and realism.