Feeds

Google's Dart on target to replace JavaScript? That'll be the day

Ecma standards effort won't topple web's lingua franca

5 things you didn’t know about cloud backup

Analysis Last week, Google announced that the international standards body Ecma had formed a new technical committee devoted to Dart, the Chocolate Factory's homegrown web browser scripting language. But don't expect Dart to replace JavaScript as the web's lingua franca anytime soon.

"The new standardization process is an important step towards a future where Dart runs natively in web browsers," Google product manager Anders Sandholm wrote in a blog post on Thursday.

Maybe. Google already offers a browser with a built-in Dart virtual machine in the form of Dartium, the Chrome variant that comes with the Dart software development kit (SDK). It could very easily roll that code into the shipping version of Chrome. But getting other browser vendors to bundle Dart VMs with their own products will be a tall order, standard or no standard.

Make no mistake; JavaScript as it exists today has its share of issues. The language was designed in a hurry and it's packed full of insidious features that make it easy for programmers to do the wrong thing, especially when dealing with large projects.

Its design also makes it difficult to get good performance out of it. Browser vendors are constantly touting the performance gains of their latest JavaScript VMs, but in truth, these increases are generally small and the rate of progress is slowing. We may soon reach the limit of how much JavaScript code can be optimized.

How do you solve a problem like JavaScript?

Switching to a different language for client-side web development could help solve both of these problems. Google says its native Dart VM already outperforms its own JavaScript VM in some circumstances. Yet to assume that Dart will become JavaScript's successor just because it has Google's backing would be a mistake.

For one thing, Dart isn't the only solution that has been proposed. Language guru Anders Hejlsberg and a team of engineers at Microsoft have developed TypeScript as another way of attacking many of the same problems that Dart aims to solve, and these days many other languages can be compiled into JavaScript and run in a browser.

Even current Mozilla CTO Brendon Eich, JavaScript's creator, has lately backed Asm.js, a highly optimizable subset of JavaScript that's designed to be output from compilers. Using Asm.js and the Emscripten compiler, high-performance browser applications can even be written in C, for example.

What's more, even if Dart becomes a full-fledged Ecma standard, that's no guarantee that it will gain traction. JavaScript itself is based on an Ecma standard called EcmaScript, but it was submitted for standardization because it was a widely used language, not the other way around.

In the early 2000s, Microsoft made great hay about its C# language being accepted as both an Ecma and an ISO standard, but other than the Mono project, most of the industry greeted the news with a shrug. These days, the current version of the language is C# 5.0, but neither of the standards has been updated since version 2.0 in 2006. So much for that, then.

But perhaps the biggest impediment to Dart gaining widespread adoption is that so far it has been developed almost entirely within Google to address Google's own needs, and Google remains its most prominent backer, if not its only significant backer. Simply put, Dart is a Google product.

The web: We do it together or not at all

That doesn't bode well for Dart on the wider web, based on past examples. Previously, the Chocolate Factory has offered up the Pepper API, billed as a superior replacement for the old Netscape browser plugin API. But the other browser vendors have mostly rejected Pepper, with Eich saying Mozilla wasn't interested in the tech until it "achieves consensus" within the industry.

Standardization might be one way for Dart to achieve consensus where Pepper has not. But that implies that other major players in the industry will participate in the standardization process, and so far there's not much evidence that they plan to.

Just like how none of the other browser vendors got on board with Microsoft's web technologies like JScript and ActiveX in the 1990s, the wider web industry is unlikely to back a Google brainchild today. For better or worse, consensus is the way things get done on the web, and that's truer today than it has ever been.

That's not to say Dart is a dead end. It still has plenty of potential as a language that compiles into JavaScript, and Google is already using it for a few major projects internally.

Google could even go ahead and release a version of Chrome that includes a native Dart VM – even if the other browser vendors don't follow suit – and web developers could serve raw Dart code to Chrome users while sending Dart compiled into JavaScript to everyone else.

But that's what Dart seems destined to remain: an option, not an evolution. Like it or not, the web already has a client-side language, and it is JavaScript. There will continue to be many tools and ways of developing applications that run on JavaScript VMs, including writing Dart code that compiles to JavaScript. But even once Dart is standardized, to expect it to replace JavaScript altogether seems like wishful thinking – mainly because it's only Google that really wishes it. ®

Boost IT visibility and business value

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
China hopes home-grown OS will oust Microsoft
Doesn't much like Apple or Google, either
Sin COS to tan Windows? Chinese operating system to debut in autumn – report
Development alliance working on desktop, mobe software
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Why has the web gone to hell? Market chaos and HUMAN NATURE
Tim Berners-Lee isn't happy, but we should be
Eat up Martha! Microsoft slings handwriting recog into OneNote on Android
Freehand input on non-Windows kit for the first time
Linux kernel devs made to finger their dongles before contributing code
Two-factor auth enabled for Kernel.org repositories
prev story

Whitepapers

Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Endpoint data privacy in the cloud is easier than you think
Innovations in encryption and storage resolve issues of data privacy and key requirements for companies to look for in a solution.
Scale data protection with your virtual environment
To scale at the rate of virtualization growth, data protection solutions need to adopt new capabilities and simplify current features.
Boost IT visibility and business value
How building a great service catalog relieves pressure points and demonstrates the value of IT service management.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?