It seems to me that if we're going to migrate away from JavaScript, let's get a serious performance boost while we're at it.
It seems to me that if we're going to migrate away from JavaScript, let's get a serious performance boost while we're at it.
Well keep in mind that every other language that compiles to JS is generally slower, so any improvement here is pretty impressive.
Note that this is just the performance of the Dart code compiled to JavaScript. Dart code running on the native Dart VM has very different, better perf.
What he or she is wondering is why one would bother with dart if it's not much, much more Runtime Scorey than JavaScript (V8).
Due the nature of the Dart language the DartVM will make a number of optimizations possible that are not even possible in V8. So it will be a better platform for continued performance improvements. Time will tell...
To be honest, even if it was only doing 0.5x, I'd still use it because the tooling makes me more productive.
With that being said, I don't believe in anything with a weak interop story unless you are talking about utilizing legacy code, for which there is none for Dart but a lot for asm.js (and pNaCl, for that matter.) So I don't really see why Dart would fare better than GWT.
Why the "still"?
If I don't have to use JS then it is worth it even if it was about the same speed.
Have you ever written a somewhat bigger JavaScript application with a few thousands lines of code spread across dozens of files? It's horrible.
With Dart, the experience is similar to Java or C# (just with terser syntax). There are classes/packages, and you can simply import things. In the IDE you get call-tips, auto-complete, and sanity checks (based on type annotations or inferred types). There is very little friction in general.
There is also block scope, a lexically scoped `this`, built-in classes/inheritance, mixins, lambdas, and things like that.
http://www.quirksmode.org/blog/archives/2011/10/dart_or_why_...
The Dart team is very aware that it is highly unlikely that the DartVM will be put into any browser except Chrome (and there is no time-table on when that will happen). That is why their Dart2js compiler is seeing so much attention from the team.
Dart, to me, is Google's new GWT, but trying to align more with the web as we know it today (instead of hiding the DOM from its users). Even if Dart is only ever cross-compiled to Javascript and used that way in production, I would prefer to code in Dart than Javascript for anything that requires more than a few lines of javascript to implement.
Nobody thought JS and Ajax was a serious thing until Google Maps came about and everyone's jaws dropped. Despite all the academic or theoretical benefits async requests it might have had, they didn't become popular until a killer application came about.
I am also thinking Dart for Android? I wish they had Python for android, but oh well, I understand it was much more of a political thing, but I can see Dart+VM being that platform.
Seems sensible for google to have some options similar to Java for both Android, and their in-house server-side code. (Oracle anyone?)
...even better performance? See the light-blue line on the graph in the OP.
See the benchmark games: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...
What's crazy to me is that SBCL still stands up toe-to-toe with say Mono (3.x, using LLVM) (or GHC or the JVM): http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te....
This is a compiler that hasn't even heard of SSA, nor any other advance in low-level optimizations in the last 15-20 years. It also achieves parity with Java on binary-trees, even though that's basically a GC benchmark and SBCL has a fairly primitive one.
It's a testament to the power of a well-tuned compiler using relatively simple algorithms and a language that is pretty amenable to optimization despite being highly dynamic.
(declare (optimize (speed 3) (safety 0) (space 0) (debug 0))
(type sb ,c)
(type (simple-array sb (,n)) ,copy))DeltaBlue:
100 / 320.84 * 512.74 = 159.81 -> +60%
Richards:
100 / 444.00 * 814.09 = 183.35 -> +83%