The Dart Hello World
Via @qrush, a nice analysis of the compiled JavaScript code from a small Dart Hello World gist. Basically, this Dart code:
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. // Simple test program invoked with an option to eagerly // compile all code that is loaded in the isolate. // VMOptions=--compile_all class HelloDartTest { static testMain() { print("Hello, Darter!"); } } main() { HelloDartTest.testMain(); }
Compiles to 17259 lines of JavaScript code. Now, most of it is just the library core, but it shows what you have to do to bolt static typing on top of a prototype-based, dynamic, truly object-oriented language.
I don’t really understand the point of Dart personally, it seems like all that’s left is some 100K line XML file to drive behavior, and now we’ve built Java executing in the browser.
Be sure you check out the comments on that gist, it’s a gold mine of ready-made memes. My favorite so far:
Classic.