Just a few weeks ago I wrote a blogpost “Can Microsoft ‘fix’ JavaScript and make HTML5 applications viable?”, where I described some of the issues with JavaScript and how these could be solved by Microsoft if they wrote a C# to JavaScript compiler. Just a couple of days ago it was announced that Google have been working on a new language that they hope will replace JavaScript and its deficiencies. This new language is called ‘Dart’.
To briefly recap my earlier blogpost; HTML5 is causing a lot of buzz at the moment, proving itself to be a serious threat to Silverlight and Flash / Flex. When meeting with out current and potential customers, who work within the financial domain, almost all of them have aspirations to migrate their desktop and web applications to HTML5. There is no doubt that HTML5 and CSS3 bring some fantastic new features to the web, making it possible to develop the kind of complex application that previously required a plugin. However, the fundamental problem with HTML5 is JavaScript, which is not an ideal language for enterprise application development.
Google recognises this issue. An internal email from Nov 2010 that outlines their strategy for ‘Dart’, says:
“Complex web apps–the kind that Google specializes in–are struggling against the platform and working with a language that cannot be tooled and has inherent performance problems”
In the past Google has used Java to JavaScript compilation (GWT) and annotated-JavaScript to JavaScript compilation (Closure) to overcome these problems. In my previous blogpost I speculated that Microsoft could use a similar approach, offering a C# / VB.NET to JavaScript compiler, allowing HTML5 developers to use the full power of Visual Studio. However, with Dart Google are looking to go one step further:
“The goal of the Dash effort is ultimately to replace JavaScript as the lingua franca of web development on the open web platform.”
That’s quite an ambituous goal!

In terms of strategy, Google have adopted a two-pronged approach. They are still participating in the standards-based evolution of JavaScript, as part of the ECMA committee. In parallel that have been developing Dart, which looks like it will be unveiled in one month’s time at the GOTO conference.
The goals for Dart are; Performance, Developer Usability and Tooling. The language will maintain the dynamic nature of JavaScript, which has made it such a popular scripting language for the web. However, it will be more easily tooled, with optional types, allowing refactoring and IDE code-comprehension (which gives Intellisense etc…) – vital features for enterprise application development.
Dart is designed to run on a VM within the browser, just as JavaScript does. It can also be run within a browser that does not have a Dart VM by compiling it to JavaScript. I think this is essential to the success of the language, allowing it to be used across any browser, regardless of whether the manufacturer chooses to support the Dart VM.
For enterprise application development, where quality tooling is very important, I am very keen on the idea of writing code using a more enterprise-centric langauges like Java or C# then compiling it to JavaScript. What I like about Google’s Dart initiative is that they are proposing to fix the issue directly at source, by replacing JavaScript.
Why not evolve JavaScript? Brandon Eich, the inventor of JavaScript, is clearly not happy about Dart, favouring evolution of the language via standards and committee. Personally I don’t think this is working at the moment for a couple of reasons. Firstly, HTML5 is upon us and gaining popularity fast, JavaScript desperately needs some attention, fast! Secondly, non-backward-compatible or breaking changes are not possible via evolution, there are features of JavaScript that really need to be broken in order to fix them.
What about jQuery and other popular libraries? If Dart is really going to fix JavaScript, I would imagine that existing JavaScript libraries will not work with it. The web developer community will probably find it hard to accept Dart without jQuery.
Will everyone adopt it? This is probably the most important question of all. It is clearly Google’s aim that everyone does adopt Dart, then they will pass it over to committee, just as JavaScript was passed over to ECMA. The problem is, what’s in it for the other browser manufacturers? How will they benefit by adopting Dart? To be honest, I can’t see any benefict for Mozilla, Microsoft or anyone else. Lars (Google Tech Lead) has promised to Lars to “sweet talk” the other browser vendors, which in acknowledges the issue they face, but since when has sweet talking been part of the browser wars?
Personally, looking at the team behind Dart and their aim for the language, I have every faith that it will be a great language. I would love to see JavaScript replaced with something better, whilst maintaining some of its more elegant features.
With so many people looking to use HTML5 as part of their future web strategy and as more complex applications are built on the web, Dart could be a good thing for all of us.
Regards, Colin E.
Tags: Dart, Google, JavaScript


email: ceberhardt@scottlogic.co.uk
on Google+



There are a couple of things they could do. First, they could simply give it to a neutral organization, like W3. Second, they could develop browser plugins that would give native(ish) dart capability to other browsers.
This is a Good Thing(TM) even if it doesn’t succeed. The language designers and VM developers behind this are literally the best in the field, and no matter what, this language will be influential. On the bytecode / compilation target language idea, I really think Dart will be versatile enough to be a fine compilation target for most languages, in other browsers the ultimate target would still be Javascript. Maybe it’ll encourage them to adopt Dart faster when it is open sourced. Honestly there is very little advantage to having a standard bytecode over source code. Bytecode tends to be very closely tied to a language specification anyway, and other languages that compile to the same bytecode have to make some compromises.
Google should create a good compilation target language. Not one intended to be used directly, but to allow other languages to be compiled down to it. Something along the lines of Coffeescript, which translates to highly readable, jslint compliant javascript.
Actually, they plan a two-pronged strategy: The first one is pushing Dart as the new language, and second one is keep on improving ecmascript, while creating a trans-compiler from Dart to javascript for those developers who seek cross-browser compatibility.
Why don’t they just create a “target” VM, allowing anyone to use their prefered language by creating trans-compilers? It works beautifully for Coffeescript…
A better idea is to push for a standard “Plugable Language Model” so that you can use the language of your choice to program the DOM, etc.
That would mean it would be possible to use C#, VB, Java, or whatever without compromise.
Browser makers would simply have to deliver their language model to the specification. Users could care less about the language used!
I think the deciding piece of information is it’s backwards compatibility with JavaScript.
If Dart can really be compiled on the fly to JavaScript for browsers that don’t support Dart natively it can really give it traction. With Chrome having 50% market share and native support and the other 50% supported with cross-compilation it can be a viable choice for corporations.
[...] Colin’s post on Dart and the other fallout from Google’s announcement across the web sparked a few thoughts in my mind, so I thought I’d share them. [...]
Hasn’t this been already done?
http://projects.nikhilk.net/ScriptSharp
[...] Dart – will Google make HTML5 applications viable? (Colin Eberhardt) [...]
Chrome will soon own over 50% of the browser market. That would make DART an industry standard. Safari will most likely support it since it runs on the same Webkit engine as Chrome. Who cares if Opera or Firefox won’t support it. And as in Microsoft there are things that can be done since MS is just playing catch-up game now and it’s left out of the innovation sector. You can always install an IE plugin to support DART.
Yet another unexpected twist in the slippery field of HTML5… while I agree with you that Dart will most likely be an excellent language, I’d be very surprised if it would become an industry standard as I don’t see a reason why Microsoft, Apple and Mozilla would want to adopt something developed by a competitor.
It seems to me that this will add to the fragmentation of the browser market, just when it seemed like with HTML5 we’ll finally have some sort of decent standard. Google are pretty much confirming this advising “We will strongly encourage Google developers start off targeting Chrome-only” (http://bit.ly/n9hTlK).
Agreed, I cannot see how “sweet talking” will pursuede the other browser manufacturers, and without that, Dart will be a niche language. Bit of a shame really.
Well I think it could work if Dart was based on C#. Microsoft would probably support that.
Then having Chrome and IE supporting this new language would probably force Mozilla and Apple to adopt it as well.
Unfortunatelly, I doubt Google will want to use C# for the very same reasons that other browser manufacturers will not want to adopt a language built by Google.