Hitting its targets

Dart can now write better JavaScript than you

Elliot Bentley

Improvements to version 1.1 include a Dart2JS compiler that outputs JS more performant than hand-written code.

new release of Dart has brought significant performance
improvements to generated JavaScript and enhanced functionality on
the server side.

Now at version 1.1, the open-source “JavaScript killer” was
created by a team at Google that includes Lars Bak, the mind behind
the speedy V8 JavaScript engine used in Chrome and Node.js. Since
the release of a production-ready
Dart 1.0 last November
appeared to fail to excite the public at
large, the race is on to convince developers of its appeal.

One of the biggest marketing bullet points for Dart has been its
speed, but this has historically only been true within the
custom-built Dart VM. Performance of the Dart VM began to overtake
V8 in September 2012, and has remained in the lead ever since.

Yet this is hardly representative of the way most Dart is
presumably being deployed, which is as JavaScript compiled via
Dart2JS – not dissimilar to the way CoffeeScript works. It’s only
in recent months that the Dart2JS compiler has begun to outshine
hand-written JavaScript.

Of the four key
being tracked by the Dart team, the Dart-generated
JavaScript is considerably faster in the ‘Tracer’ test, and
JavaScript and Dart2JS are currently neck-and-neck in
‘FluidMotion’. On ‘Richards’, too, Dart2JS is 94% as fast as

It remains to be seen if such increases are enough to lure users
of vanilla JavaScript or existing preprocessing language users. The
truth is, though, that this doesn’t matter: Dart is designed for
teams building Google-sized front-end projects, and could become
popular within this niche without being widely adopted.

In addition, like JavaScript on Node.js, Dart may find a
parallel life on the server with the dart:io library. The
Dart team has been enhancing the language’s server-side features,
which as of v1.1 now includes support for large files, file
copying, process signal handlers, terminal information and UDP.

The most powerful way to push Dart adoption would obviously be
to integrate its VM into the mainline Chrome browser, but there’s
still no word of this happening. It seems the Dart team still have
their work cut out in bringing the rest of their colleagues up to
speed on their wunderkind.

Photo by Emilio

comments powered by Disqus