This article is more than 1 year old

Google's JavaScript assassin: Web languages are harder than VMs

Dart daddy Lars Bak: JavaScript? I have no problem with it

'I have no problem with JavaScript'

Bak reckons Dart is ideal for Gmail. Google's email service has 1MB of source code that must be read before starting, but Dart’s structure lets the VM take a snapshot that’s stored in the browser, which can be booted up in one-tenth of the time it takes to load the full code from scratch. “That’s hard to do in JavaScript because in setting up the program you have to execute the source code; that source code has side effects and those side effects cannot be snapshotted,” Bak said.

Dart helps on things like 3D gaming. A detailed structure of objects means the VM doesn’t have to take time running floating point connections to run new objects, which puts extra pressure on the garbage collector.

Bak now reckons Dart runs 30 per cent faster on Google's V8 than JavaScript under the Richards operating system kernel simulation benchmark and under the DeltaBlue benchmark – two standards used at Google. The goal is for Dart to become twice as fast.

Technology is one thing but overcoming the industry’s politics is a factor, too.

Bak's team has two hurdles to clear. Firstly, Apple, Microsoft, Mozilla and Opera will need to be convinced of the technical merits of Dart. But secondly, they will also need to be persuaded that Dart is not a cuckoo's egg that Google is trying to lay in their browser nests to take over the internet, that it's not a means to plonk them on a Mountainview roadmap or shoehorn them into helping Google’s search, advertising and web properties to the detriment of their own.

That memo on replacing JavaScript won’t help - it was strongly worded stuff. Googler Mark Miller in 2010 wrote: “The goal of the Dash [the initial name for Dart] effort is ultimately to replace JavaScript as the lingua franca of web development on the open web platform,” he said.

“This is not taking anything away from JavaScript... we have to make sure the web really competes well. With the mobile ecosystem we have to do a lot of innovation in the browser,” Bak said.

“While Dash is catching on with other browsers, we will promote it as the language for serious web development on the web platform," Miller continued in his October 2010 internal memo.

Google was promising to play nicely and be a good member of the JavaScript team, evangelising it in public for the next version of JavaScript – codenamed Harmony. Behind the scenes, though, it would evangelise Dash among web developers and browser makers and push for standardisation "and adoption across the board".

The memo leaked as Google revealed Dart at the Goto Conference in 2011.

Bak says Dart makes programmers more efficient for the web and notes that neither he, nor Google, has "a problem" with JavaScript. He points to his history on V8 as proof of his commitment - and Google's - to the language.

"This is not taking anything away from JavaScript... we have to make sure the web really competes well. With the mobile ecosystem we have to do a lot of innovation in the browser," Bak says. "I have no problems with JavaScript."

He does have a point: V8 helped push browser-makers in to competing on JavaScript rendering speeds, producing a battle of the benchmarks between 2009 and 2011 so tech companies could all claim to have the "fastest" browser on the web. Today, JavaScript is running faster in the browser than at any time.

V8 helped change the web development strategy of the world’s largest software company – Microsoft. As Mozilla and the WebKit team were working to become the fastest JavaScript engines on the web and Microsoft risked being branded the web's slowest browser, the kiss of death among devs who are the gatekeepers to what gets built and used in software.

C++ or ColdFusion - Dart's future

When Microsoft released IE9, it dumped more than a decade of history of forcing devs to build one version of their sites for Microsoft's browser and another version for everybody else. For its new browser, Redmond went with a standards-compliant and streamlined JavaScript engine, Chakra. Chakra helped Microsoft run that benchmark race.

Fate is a shifting force in programming languages. C++, Java and PHP are today riding high, but for how long? Others that were once big - such as ColdFusion from Macromedia and Adobe for rapid web application development - are now in terminal decline.

JavaScript was standardised as ECMAScript in 1997 - as ColdFusion was on the rise - but it was only within the last half decade that it come into its own. This is because devs were finally recognising JavaScript's power as a client-side language that came with the familiarity of C and Java, but without the problem - thanks to the ECMAScript standard - of being tied in to a single vendor's runtime or roadmap.

Now, there are moves afoot to extend it further on the server with Node.js.

Bak is confident Dart has a long future at the top and feels working for the internet's largest search and ad company will help propel it. Yet Dart must gain credibility inside and outside the Googleplex. It also remains in desperate need of a finished VM: the "snapshotting" that would allow Dart to spin up services such as Gmail more quickly than can be done in JavaScript is dependent upon the shiny new VM.

But, as we know, VMs are Bak's territory; it's languages that are tricky.

“Most people talk of a long adopt period – more than five years. We have working on this for two years and we already have good community. It looks pretty good, I’m very optimistic right now,“ Bak says. “This [Google] is the right place to do these projects.” ®

More about

TIP US OFF

Send us news


Other stories you might like