OPEN COCKPIT DAY at Naval Air Museum Barbers Point @ Kalaeloa Airport was awesome. Excellent display of air crafts and very informative!
Could Dart become the NB[J]VL (Next Big JVM Language)? Wait, did I just say JVM, Dart is a VM based language that could run on JVM as well (jdart), but could a language outside the JVM ecosystem beat the expectations of the NBJVL. In his blog entry, Stephen discusses what a new language should address to become the NBJVL. Just for those curious, Stephen concludes by saying that backward incompatible Java 8 could be the next best bet, which is unlikely to happen with major features already frozen for Java 8 and its release pushed to 2013, although reification is planned for Java 9, a long way to go indeed (2015?).
Does Dart fit the bill based on his definition of NBJL? Well, let us dig in further to see if Dart bites the bullet.
In terms of features, NBJL should probably have:
Let us discuss briefly on each of those features:
Looks like, Dart scores on most of these aspects. Dart is young, and many things would shape up in the coming months making it an even strong candidate.
Dart offers quite a number of interesting goodies which I consider as a bonus:
There are a number of nice little things, but I’ll leave them for another post.
When Dart was officially announced, it was mentioned:
On the mobile front, Dart is going to make a huge difference atleast for Android. I believe it should be possible to produce Dalvik compatible .dex files using a backend similar to one which produces JS from the DART AST. Not sure how hard that would be. This would also mean generating Dart scripts from Java classes (java2dart).
Java developers for sure would feel home in Dart. Why would the NB[J]VL miss an opportunity to woo 10 million Java developers, leveraging familiar syntax? Food for thought :-)
In addition to traditional for loop (C++ style) and for-in loop (Java/C# style), Dart adds a convenient forEach method construct that takes a function and operates on the Collection. For example, using forEach() on a Map:
Using forEach() on a List/Set:
The only limitation with this approach is you won’t be able to break out of it. Dart doesn’t have non-local returns, so in that case you may want to use the for-in loop.
Another approach suggested in the dart user group is: