I hope Google isn't going to solely rely on Chrome having a Dart VM to increase Dart performance. As it stands; no other browser is interested in the Dart VM, so your app will only benefit from the speed in Chrome while other browsers are at the mercy of the efficiency of the Dart->JS compiler. If the compiler can produce near-JS performance I wish them and Dart developers well, otherwise using Dart will only handicap you in other browsers. Chrome has a respectable market share on the desktop, but mobile will be dominated by Safari and Android's stock browsers for at least another year (Chrome-Android is ICS only); thus you're at a complete disadvantage on mobile.
If Google wanted a second language on Android, they'd have it by now. Either golang or JS+V8 (possibly out-of-browser) would have been fine choices. As well, Dart's stated goal is "structured web programming", and parts of it's design are constrained by the need to run within the browser and compile down to JS. Imposing those same restrictions on Android development would be counterproductive.
One of Dart's design goals is to be able to be compiled to efficient Javascript. That does limit some of the choices that the language designers can make, but it means that there should be good performance on all modern browsers.
The VM presumably takes advantage of the slightly less dynamic nature of Dart to make more agressive optimizations than V8.
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.
I for one welcome Dartium. I need to learn the language and JS compilation was an unnecessary barrier. I care less about people's whining.
A language that does not suck? Check.
Is it multi platform? Check.
Can it work in other browsers if necessary? Check.
Is it open source? check.
Can it run in server? Check.
Is it fast? Check.
You could take one of dozens of language and mark "check" for each of those points. (And the first one is questionable anyway, there are better languages). So why Dart rather than some other language? What's it's real selling points?
Perhaps the strongest thing going for Dart is that there's a big company with resources behind it. Unfortunately, this is also the worst thing about it. Google's lack of effort to involve other browser vendors and the community at large in it's development is ultimately the reason why not many are interested, aside from whether or not the language is any good.
> Does it support prototypal inheritance? (also great)
No. Dart has classical inheritance, which by the large number of classical inheritance libraries for Javascript, is still very popular even when prototypal inheritance is available.
I personally abhor prototypal inheritance. It's aesthetically unappealing, hard to reason about, hard to optimise, and turns what is usually a declarative pattern into an imperative one. When most people are approximating classical inheritance anyway, that's a big sign.
It's sometimes nice that objects can differ structurally from their class, but I've never found it that useful.
Ah, you are right, it doesn't support prototypal inheritance.
"When most people are approximating classical inheritance anyway, that's a big sign."
Two things on that:
1. Most people (vast majority) learned OOP in a classical style, so that's what they're going to be comfortable with and will try to implement. It doesn't automatically mean classical style is superior.
2. You may want to check out the Klass library[1]. It provides a "classical interface to prototypal inheritance." So perhaps classical style is easier to use, but prototypal is better to have in the background.
Sorry, I don't think you understand how OOP works. In classical inheritance, each object only contains its data and a reference to its class. The class owns the methods - they are not copied to every instance. Most uses of prototypal inheritance follow a similar pattern.
Every language under the sun has closures and first class function objects now (Even C if you count llvm-specific extensions, and Java if you count one method interfaces as a suitable workaround until version 8).
Also, Javascript's version of prototypal inheritance isn't very good. Name me one thing you can do well with Javascript's inheritance that you can't do well in any other dynamic language with some notion of objects having property dictionaries (Perl, Python, Ruby, Lua, etc.).
How much faster can we expect Dart apps to run with the VM vs JIT'ed JavaScript? If we can get a 5x-10x boost, I think a lot more will become possible in the browser. At some point, I would hope Webkit and Firefox would adopt it. Why not?
If Google was only interested in putting a faster language into Chrome they could have just shipped with LuaJIT for Lua and been done with it. Obviously they're more interested in playing around in their own sandbox (Dart).
The WebKit maintainers already refused adding Dart support on grounds of not being a web standard, not wanting to fragment the web any further and not wanting the extra maintenance burden for the changes required to WebKit in order to support multiple scripting languages. Same reasoning goes for Mozilla, especially because they don't see Dart solving any problems that either couldn't be solved in a future version of JavaScript or that warrant the pains of having to maintain two different scripting engines. AFAIK Opera also didn't show any interest in it.
So Google's only hope left is for Chrome to gain monopoly-level market share to simply force the remaining browsers into compliance.
I wish Google would just embrace CoffeeScript instead of this. It's a prettier language, and already solves many of the problems Dart is concerned with.
While I don't think Dart is the most interesting language I've seen (optional types and mirrors aside), CoffeeScript doesn't try to solve any of the problems that Dart is attempting to address.
Of those five, the only one that CoffeeScript doesn't emphasize is "high performance/fast startup", which basically can't be a goal for a language without its own VM or JIT.
It seems to me that focusing on adding this one emphasis to CoffeeScript would make a lot more sense than making yet another not-exactly-Java.
Read closer - those goals are modeled around the 5 perceived problems enumerated below them. Those aren't the kinds of problems that CoffeeScript purports to address at all. CoffeeScript for better or worse is mostly "Just JavaScript"
> Those aren't the kinds of problems that CoffeeScript purports to address at all.
Right. I think Dart's general goals are good, but I think they're wrong about how to go about it. I don't think most of the "problems" they enumerate are actually the obstacles that prevent their listed goals from being achieved. I think they are things that bother programmers whose thinking has been infected by too much Java.
Performance is a design goal, but it is not given as the primary goal.
Of course, a cynical observer might say that the real primary goal of Dart is to give Chrome an artificial performance advantage over competing browsers, since that will be, at the very least, an initial effect if Google succeeds in promoting its adoption.
I think you're pretty naïve if you think that "Google doesn't care if Chrome is perceived as faster". That's been the entire thrust of their marketing, quite literally from day one.
As it stands today a Chrome user is no more valuable to Google than an IE user (well, apart from google being default search provider).
But any web user today is more valuable than a web user 3 years ago because the browsers deliver a much better experience now, causing the user to spend more time on the web.
Chrome played a major part in this development.
A chrome user is more valuable to google than another browser user:
google paid 1 billion dollars for a search deal to Mozilla with ~30% mkt share. If google had never built chrome, Mozilla share might be 50% or more today. The search deal would've been commensurately more expensive.
The point is, google doesn't have to pay for search engine placement for a chrome user.
> (well, apart from google being default search provider)
That's a rather significant difference, you know.
But control over a given user's browser has incredible potential value for Google. Controlling both client and server means that you no longer have to sacrifice performance in the name of standards compliance (so long as you have a standards-compliant fallback mode for other browsers). What that means if you're Google is that a visitor using Chrome can 1) cost you fewer resources, and 2) walk away with a smoother, more satisfying experience.
Does Google currently take much advantage of this potential? I can't say for sure. But we are talking about a company that omits the </html> on its homepage in the name of performance.
"As it stands today a Chrome user is no more valuable to Google than an IE user (well, apart from google being default search provider)"
I'm not sure your caveat is needed -- on a new installation the first thing Chrome does is ask you what search provider you want to use, you're just as free to pick Bing as Google.
Chrome does this, but IE does not. That alone means that a much higher proportion of Chrome users will use Google than IE users. Then factor in the relative name recognition for the two search engines...
Why would it be an "artificial" advantage? Chrome exists because Google wanted to push the web as a platform forward and encourage other browsers to evolve. That's what happened with Javascript and SPDY (_very_ rapidly with SPDY, it seems to me).
If Chrome is faster at running Dart it will only really matter if 1) Dart is also faster than Javascript and 2) Dart is better for building complex web apps. That would validate the "clean break" approach as an alternative to the evolution approach. I don't see what makes that "artificial".
If Google successfully gets people to adopt Dart, but other browsers rely on JS cross compilation while Chrome has a dedicated VM, then there will be a period during which Chrome has an artificial advantage. This is a virtual certainty.
Dart might also have real advantages, and those would be enjoyed by all once other browsers provided fast implementations. But initially, Chrome would enjoy an artificial advantage even if Dart was actually worse by design than JavaScript, so long as they could get a significant chunk of web developers to adopt it.
My point is that getting people to adopt a technology that your product pioneers confers on you a market advantage independent of the actual merits of that technology.
And yet, oddly, one of the front-page testimonials for node.js is LinkedIn saying that use of that particular brand of server-side Javascript gave them "huge performance gains". That obviously doesn't mean that Node (or Javascript in general) will perform well in every situation, but it does show at least an existence proof that JS is capable of high performance in some very demanding environments.
What I haven't seen out of the Dart project, so far, is a description of what performance targets they're trying to meet, why they think that no set Javascript extensions (e.g., the "freeze" proposals for Harmony) would suffice to meet those targets, and why they think that any of this is relevant to people whose needs _are_ adequately met by Javascript as it stands.
So your justification for Dart being unnecessary is that the Javascript interpreter built by the people who are building Dart is really fast (for a Javascript engine)?
Don't you think that building V8 (the engine inside Node) may have given them some very good insight into the upper bounds of Javascript performance and insight into ways to fix them?
If v8 is fast enough for anything that I might want to do with it, further performance improvements (as opposed to other changes) are not going to be really high on my wish list. That's why the performance case doesn't work for me.
Other people might have different tradeoffs, of course. Which is fine. But nothing I've seen the Dart crew say yet explains in plain English who those people might be, and why the particular set of tradeoffs in Dart is better for them than either v8 or, say, some other language reduced to strongly typed bytecode for PNaCl.