Google is a large company that is pushing various tech from a lot of different angles. You have the V8 team that has done a lot of great work for Javascript speeds. Members of V8 also were part of the EMCAScript committee to help move the language forward. With Google's focus on Dart, some of those V8 members have moved on to Dart.
Google has also been doing a lot of work with the Shadow DOM, Polymer, and lots of other fun tech.
Dart is an experiment to see if they can create a better scripting language for the web. Who knows if it'll work out, but it's nice to see a company trying something a little out there.
I'm sure creating large web apps like GMail or Docs in Dart would be much more pleasurable than doing it in Javascript. For smaller scripts just to do simple form stuff, it probably won't be any better (but hopefully not worse than Javascript today).
The point of view within Google that spawned Dart is that JavaScript as a language has major and unfixable flaws that severely raise the cost of developing large apps. It's nice that node.js uses V8, but being based on a Google project does nothing to address the language issues.
Note that that point of view is not universally shared at Google, and many people are fine with JavaScript, and probably would use node.js.
Dart is Google's JavaScript. JavaScript was developed exclusively by Netscape and forced upon the web because of their dominance. Everyone agrees in hindsight that it was bad to do it that way. And now today Google is attempting the same thing.
I believe it has a lot to do with internal Google politics.
Back in 2004, Google hired Lars Bak and his team (who had previously created the HotSpot VM for Sun) to create the V8 JS engine for Chrome. Their work was a spectacular success. Overnight, JS became one of the fastest dynamic languages in existence, and this ushered in an arms-race for better JS performance across competing browsers.
However, after a few years of wringing ever more speed out of JS, Bak and co. were totally fed up with it. In particular, how its various quirks prevented a lot of the optimisations they wanted to do. Afraid that Bak would quit, and maybe go work for a competitor, Google schemed to keep him. They let him design his own new language (originally called Dash, later Dart) that would be more amenable to optimisation, and planned to ship a separate Dart VM within Chrome.
However, these plans got leaked, and caused a bit of a furore back in 2011. The feeling was that Google were attempting something of an Microsoft-style takeover of a big chunk of the web platform. When other browser vendors said they wouldn't ship a Dart VM, they plan was dead, sort of. Google still wanted to keep Bak and his team on-board, so they let them continue working, and they developed a Dart-to-JS compiler so Dart could run on the web without a separate VM.
Google's big enough and rich enough that they can afford to run plenty of these strange projects. And if Dart is popular internally, and delivering value, why kill it? It is ironic though that of all the big web platform technology plays that Google have made — GWT, Dart, Polymer — the one that went stratospheric was Angular, a random, minor open-source project without any place in the grand strategy.
Incidentally, one side effect of all this was that Chrome's V8 engine lost most of its key developers, and so its progress stalled for quite a while. Eventually Google formed a new team V8, based in Munich, to pick up the ball. That's why there's been so much more progress on stuff like ES6+ features and better JIT compilation in the past year or so.
"if the VM eventually becomes much faster than the dart2js path, Google can essentially force other browsers' hands by adopting Dart on Google sites"
Or all of the browser vendors could sit down and design a new language based on the experience gained from implementing Dart. This new more easily optimizable language can become a new web standard. After all this is what happened with SPDY and HTTP2.0. This "new language" could also just be a new version of Javascript with a few backwards incompatible changes.
One interesting claim of the DartVM authors is that they have achieved a 10x start up gain over Javascript when using script snapshots. If this turns out to be true, it will add significant pressure for other vendors to implement a similar feature. The only way to get this to work in Javascript is to make backwards incompatible changes. For example only allowing a static top-level structure, as in Dart.
I see the competition from Dart as being good for end users, as it adds pressure on Javascript to evolve. It's also interesting to see the V8 team porting a number of Dart's optimisations to V8.
Dart is a solution for building and maintaining complex web apps. Googles JS web apps has 100's of engineers working on it spanning millions LOC. Google doesn't think it's possible to develop at this scale with vanilla JS which is why they've invested a ton of effort in developing the Closure Compiler/Library and GWT (i.e. what their big JS Web Apps use). The problems with the previous strategies is that they add boilerplate, artefacts and complexity on top of JS that slows down their build times to the point where some devs have to wait 24mins to see a live/edit reload cycle. Dart was built from the ground-up to manage complexity and to provide a consistent development experience with the goal of providing the fastest edit/reload dev cycles possible. As it's also built with the input of the VM engineers who helped create StrongTalk, Hotspot JVM, V8 VMs they are able to add features that enable a high-performance VM implementation and enable features like 'Snapshots' to provide instant start up times.
Google will never drop support for their 2 crown jewels, Chrome or Android. When Dart gets into Chrome and some of their big internet properties start to depend on it, you can pretty much guarantee that they'll never drop support for it. One of the mandates Google has is to improve the web, make it faster and make it possible for everyone to build richer more interactive web experiences so more people use and spend more time on the Internet. More time on the Internet means more time on Google, so developing and investing in technologies like Dart indirectly benefits them. It's also why any investments on improving the Internet remain supported, free and Open Source e.g WebP/M, SPDY, Chromium/Blink, V8, Closure Library, GWT, mod_pagespeed, Polymer and now Dart.
People like to confuse Google's dropping of support for their products where everything they create is fair game and can be dropped at anytime, what's not looked at, is how the product to relates to their entire ecosystem, whether it adds value and is in a growing technology/market.
V8 was simply a drop-in replacement for existing Javascript VM's, so there was no "adoption" curve, per se. It ran something like 40x faster than the one in WebKit when it was released, so everyone just said "Awesome, thumbs up! Stick it in there."
Google is spending some developer relations resources promoting Dart, probably because it's the kind of project that requires more public buy-in (including a VM that ultimately needs WebKit hooks, which is not solely controlled by Google). But it still has to surmount the same hurdles to internal adoption that other tools and languages do. I'm no longer privy to the details, but I'm fairly certain that there are just a few internal teams trying out Dart right now, to help it get its "sea legs".
And that's really the way it should be. These things don't happen overnight, and edicts from on high that a particular team will use a new technology don't usually work out well.
Quite right too. Too much of what I've read on here and in the dart forums is "I thought it would be more like..." and "google have just created something to aid their development toolchain."
I view dart as javascript grown up. It's not that much different from java et al, but it's different enough.
Only time will tell if it will replace javascript, but I'll be doing my bit to help.
> No other browser can practically implement or support Dart.
They don't have to, they can use the Open Source DartVM as-is, in-fact this is what Google encourages, just like how node was able to use V8 JavaScript engine - which they've said is an example of new use cases that's possible when you create a high-performance VM.
> Google's engineering could have gotten JS much farther along
Lars Bak and Kasper Lund on the Dart VM are the same guys on the V8 team, who were also on the world-leading JVM Hotspot compiler that was derived from the Strongtalk VM (the fastest implementation of Smalltalk) that they created. They believe performance of JavaScript is reaching its peak and is unlikely to see another 2x improvement, JS VM's are also extremely complex as JavaScript is extremely hard to optimize.
By contrast Dart is a much simpler and predictable language designed for both productivity and performance and because it was designed in-hand with the VM engineers, language features are designed in a way that performs well.
The Dart team is not a large team and not an arrogant team. Led by Lars Bak, they thought to try and make something that ran faster than JavaScript by doing away with 'monkey patching.' Lars and Kasper Lund took all their experience working with V8 to make something that avoided the bottlenecks. Gilad Bracha designed a good working language and it works without many "gotchas" along the way. It's a pleasure to use. The Google Chrome team was not enthusiastic about it even before Blink, as you correctly state, but what I was trying to say is that if the industry hadn't reacted so negatively to Dart because of some percieved ulterior motive by Google, the Chrome team may have been persuaded to put some more thought into it and make it happen. Lars Bak, Kaser Lund, Gilad Bracha and the rest of the team did something cool and don't get any props for it because they work for Google. Such is life. I recall Mozilla disliked it the most, which I assume was driven by you, the creator of JavaScript. Dart was never going to replace JavaScript you know, because even then they were saying that anything that can be written in JavaScript, will be written in JavaScript. JavaScript is unstoppable, but people should look at Dart for what it is, another tool in the toolkit.
> Google started their proprietary ... Dart project because they claimed you couldn't make JavaScript any faster than it currently is
No, they didn't. Google started Dart because they had a bunch of Java programmers who were having good success building JavaScript web apps such as Gmail with Google Web Toolkit. They thought to formalize it with Dart instead of using a hacked up Java dev environment. I have a client who needed a web app fast, so I took a chance on Dart and did it in half the time. The client doesn't even know I'm doing it in Dart. I'm shipping the minified js file which works on all modern browsers because the Dart team set out to bring jQuery up to a higher level. There's a bright side to all the dislike and misinformation about Dart though, because it gives me a competitive edge.
Dart was conceived as better than Javascript, but it ended up drawing the short straw in the browser. It ended up with shit on its face, so to say. So people identify Dart with that expression.
But nothing could be further from the truth. It is a modern productivity language, like Kotlin. Anyone will be productive in a matter of a few days.
With such a low barrier, why then carry on the legacy of Javascript with its weird edge cases? So I think Google made the right call.
I'm just concerned that Google (being both the origin of Dart and a prominent developer of webapps) will spend most of their development time writing Dart apps running on their Dart VM and slowly begin to neglect (remember, doesn't necessarily have to be malicious) the performance of their JS output.
Google's own developers use Dart for Google products, no? I think that pressure is grassroots even if it is internal. And even if Dart remains permanently a compile-to-js language, as tragic as that would be, it's still an incremental improvement over GWT.
Most (all?) of the improvements listed in the document are already present in Dart. You can use them today. Good to see that these may also filter into JS in a few years time.
Google is capable on working on improving JS and Dart simultaneously. You can see Dart as a test ground for features that may make it to JS. Cross-browser improvements made to JS will also benefit the Dart ecosystem, as it is a compile to JS platform.
Don't expect Dart to disappear any time soon. Despite popular rhetoric, Google actually has a good history of supporting its web programming platforms, for example GWT and Closure.
First, Dart has a specification that's independent of Google's implementation(s). There are several implementations, which track the spec to varying degrees. See http://www.dartlang.org/docs/spec/index.html
Second, Dart is far from finished. It was unveiled early, precisely so interested parties could try it out and provide feedback while the spec was still evolving.
Third, development is happening in full view, with a public source code repository, public mailing lists, public bug tracking and public code review. AFAIK all the committers are still at Google, but it's a far more open process than the one that created Javascript, and not even comparable to VBScript.
Finally, Javascript is defined as "what SpiderMonkey does." Ok, it's fairly well documented, and the source is available for inspection. But Javascript is a proprietary language owned by Mozilla. ECMAScript is the open standard, and there are significant differences between that and the Javascript implementation that's included in Firefox. Why isn't anyone jumping up and down about how Mozilla is breaking the web by shipping a non-standard proprietary language controlled by one company?
I'm not a Google apologist; they've definitely done some evil things lately. But Dart isn't one of them. AFAICT, they've tried to strike a careful balance between including the web community in the design and implementation of Dart, while still holding to their vision of what web programming could be, and advancing towards it. I think they've done a pretty good job and I don't see what they could have done better. Herding cats is hard.
I'm mostly a backend web developer but I'm really curious to see where Google is going with Dart + AngularJS. I think there may be something interesting there, for those like me who don't like javascript!
Thanks for explaining the process. I like Google's evolutionary approach, but it sounds chaotic to someone like me from a Microsoft background. The top down command hierarchical structures appear to be losing all over to the networked evolutionary approaches, so I have no complaints. But I wonder, does that mean someone inside Google could use TypeScript? This might be a blind spot.
Also, I meant it will be interesting if no team chooses to use Dart on the client, but it gains interest on the server. Presumably teams go with what makes sense and that will be interesting to watch.
> I think people need to chill out and stop aggressing against anything that threatens Javascript hegemony
They have over the last 6 months as more and more people are realizing that pure JavaScript is not entirely suitable for large scale applications that are becoming more common. As someone said, the efforts to make it so are 'heroic,' but obviously the hard way to do things, like choosing to write a large application in assembly language. Having done that once, I would never do it again, and would take someone who said this was best less seriously.
Dart is targeting HTML 5 capable browsers and ECMAScript 5 capable browsers... which tends to means stuff that is current as of today. As google tries to run on some older browsers as well, dart is not a good solution.... yet.
There are teams within google that are starting to build sites with it, but nothing is public yet.
I am pretty excited about this. I have been using Dart since it was announced and the only downside I have experienced so far was that I had to rewrite half my code every two weeks as the language changed, although this was entirely expected.
Now that the language is a stable target I am really looking forward to seeing what sorts of libraries can come forward and also how performance can improve using the VM on the server side.
Warning: The rest of this comment is somewhat controversial and speculative. Feel free to skip it if that is not what you want.
In the bigger scheme of things I have somewhat conflicted feelings about Dart. Google has been trying very hard over the last few years to kill whatever positive feelings I had towards it for their open-source, open-web stance. A million little things like dragging their feet on chrome/webkit prefixes, google+ infiltrating everything, etc, etc have made me more appreciative than ever for Firefox and Mozilla. But in the 2 years since Dart was announced it has gone from a basic spec and vm to a fully functional and pretty great language and vm, while Javascript has languished in committee as more slop is packed in while the basics (numerical types, non-terrible type coercion) are ignored. The current target is a late 2014 release date. How much further will Dart and its VM be by then!?
I love Dart for what it lets me do right now, and for its commitment to compiling to javascript so everyone can use it. But it's hard to trust that google won't use it as some sort of competitive weapon in the future. And so I am stuck, wanting to support the open web, while being unable to stand the leap back in time and productivity that is developing in Javascript.
I guess the only thing to do is focus on getting things done in the here and now and let the future take care of itself. And right here and now Dart is a pretty compelling package.
Google has also been doing a lot of work with the Shadow DOM, Polymer, and lots of other fun tech.
Dart is an experiment to see if they can create a better scripting language for the web. Who knows if it'll work out, but it's nice to see a company trying something a little out there.
I'm sure creating large web apps like GMail or Docs in Dart would be much more pleasurable than doing it in Javascript. For smaller scripts just to do simple form stuff, it probably won't be any better (but hopefully not worse than Javascript today).
reply