digital wave / Reiner Pittinger: iOS, Web Technologies, Interaction DesignSoftware Development in Berlin: iOS, Web Technologies, Interaction Design

Google Dart Event

Dart Logo

Last week I attended an event focused Dart, Googles new programming language which raised rumors to replace JavaScript.

Organized by the Google Technology User Group Berlin, the event was split in two parts:

  1. Get a feel of Dart: syntax and sugar for it, trying out the language, samples and the editor
  2. A rather lengthy presentation by Florian Loitsch (engineer in the core Dart team) with an overview of the language and its features to convince us of the greatness of Dart.

Why did Google invent Dart? Because they were not satisfied with developing really big applications in JavaScript. Side effects, slow tests and lack of tool support were the main reasons why Dart was created.

Pros for Dart

Dart seems like a mix of nowadays favorite programming languages, including Ruby, CoffeeScript, Scala and Googles beloved Java.

Compared to JavaScript, improvements include:

  • Optionalally strictly typed, so instead of var name = "Reiner" you can write String name = "Reiner"
  • Clean syntax including shorthands for constructors, lambdas, string substitution etc. (resembles Ruby)
  • (non-prototypal) Classes, Interfaces (comparable to CoffeeScript)
  • final variables, lists with specfied content-types, e.g. List<String> names = new List<String>() (resembles Java)
  • Performance improvements
  • Better tool support: this is acutally one the strongest points of Dart. Because you will probably opt for strictly-typed libraries, the editor can give you code completion and propose applicable methods when handling an object. In JavaScript, a feature like that is hardly possible (as the actual object behind a var is often unclear until the program is run.)

Reasons against Dart

  • Dart needs it’s own VM to compile and run the .dart-files. There is a dart2js compiler, but you loose at least the performance improvements with it. Google aims to convince the WebKit-Team to integrate a Dart-VM into WebKit, but I think that’s quite a long shot and does not solve the problem for other browsers like Firefox and IE.
  • Using Dart together JavaScript Libar is discuraged due to garbabe collection accross muliple VMs (with Dart-objects referencing JS-objects and vice versa).

My conclusion

Currently, I do not see Dart as the next big hit from Google.

Instead of trying to fit into the active and rich community of JavaScript projects, Googles takes its own approach and starts from scatch. “We didn’t like what was there and created something new”, that might work for Google, but I see few other reasons why to use Dart.

With its quasi-incompatiblity with existing JavaScript, I recommend you have a look at Dart (you can browse through everything in about 40 min.) and leave it there for now.

Darts future still is open and it might improve web development, but can also be a fail like Google Wave.