Monday, October 10, 2011

Dart. What's the point?

Dart is a nascent web development language. What's the point? I observe two.

Uniformity and familiarity: Like Node.js, Dart wants to run both in the browser and on the server. It tries to look familiar to both JavaScript and Java developers, so that either can adapt quickly. The goal is to move away from having different languages on the front end and the back end. Implement a new user story all the way through the app without switching languages at the client/server boundary.

Evolution from prototype to real app: Several features in Dart aim to smooth the transition from quick proof of concept to real, maintainable application. These include:
* turn a property from a simple field to a something with defined getters and setters without changing any code outside the class. Getters and setters look identical to public fields.
* change a constructor into a factory method that may or may not return a new object, also invisibly to any code outside the class.
* start with dynamic typing (everything is declared as "var") and move to dynamic typing.
* an interactive console in the browser makes very simple tests very easy.

One syntax feature in Dart that jives with CoffeeScript (as presented by Mark Volkmann last week at Lambda Lounge) was single, double, or triple-quoted (multiline) strings with interpolation of variables and expressions.

In some ways Dart stays closer to our familiar OO-languages; variables are mutable by default, and classes are the way to organize code.

Does Dart hit the target? It looks interesting, but it's still very much under development. The interactive console doesn't work in my browser (IE8 - I'm at work). On the server side, Dart runs in a VM. How good is the VM? It is too early to tell - we'll have to wait and watch to see whether Dart sticks.

No comments:

Post a Comment