# On Dart
Posted 09 Jan 2014. Tagged: dartdart recently reached 1.0 and is also heading to ECMA for standardisation. A great time to check out Google’s javascript replacement.
At first glance dart is a bit of an ugly duckling: it seems rather bland and dull, its syntax looks old fashioned. But look a little closer and you will discover that is actually quite a gem.
-
dart comes with real dependency and build management.
pub
provides a comprehensive set of commands to build, publish and handle dependencies of your project(s). -
dart is fast. While benchmarking is not a reliable measure of performance, the available data indicates that dart (and
dart2js
) compare very favorably javascript. -
dart is built for the web. While mainstream browsers with native dart support are still a thing of the very distant future,
dart2js
allows for efficient compilation to javascript. In the same vein dart ships with very intuitive javascript interoperability. -
dart is convenient. Arguably the most important feature of dart is its (optional) typing. I find that typing improves maintainability, readability and makes the tooling more powerful.
dart also comes with scores of other handy features, such as string interpolation, useful syntactic sugar and a powerful standard library.
After the short dart tutorial and a cursory glance at polymer, I have decided to rewrite talaria in dart. So far the process has been rather fun, polymer is incredibly powerful and writing polymer components in dart feels intuitive and straightforward. dart itself is really fun to write and the IDE makes getting started really simple.
Of course dart still has its fair share of rough edges:
- In many ways the documentation1 is as inaccessible as the erlang documentation2.
- On OSX the dart IDE has a number of annoying bugs, most notably autocompletion regularly fails to work as expected3.
- The ecosystem is still in its infancy, this is exciting because there is a lot of opportunity to get involved, but also means that a number of the libraries you have come to love are not yet available or only exist as very early releases.
From my short experimentation with polymer, I believe that it will play a big part in the future of web development. It just makes sense. dart on the other hand is a no-nonsense tool that takes some of the pain out of javascript. It is a modern and effective language for (full-stack) web development.
-
With the obvious exception of the excellent introduction offered by the dart book. ↩
-
While initially inaccessible, erlang’s documentation is among the most complete and comprehensive once you get your feet wet. ↩
-
Selecting one of the provided completions fails: Both the popup and the editor react to keyboard events. This means that by the time you select a completion, your cursor has moved away from its original position, and hitting
enter
adds a new line at some unexpected location instead of finalizing the completion. Double clicking a completion often does nothing at all. ↩