November 3, 2012

Dart - the king of speed

The web as a platform is moving at an incredible pace right now. The modern web browsers are getting better in supporting the new HTML5 standards. Javascript runs 100 times faster now compared to 2007, according to Lars Bak the designer behind V8. Rich web applications are now developed as a single-page with most of the logic on the client. The gap between web applications and traditional native desktop application is getting smaller.

Chrome V8 performance from Google IO 2012 
I have a long experience in writing large-scale applications in Java using modular and object-oriented concepts on the Eclipse Rich-Client Platform. I have used the Eclipse Modeling Framework (EMF) to generate editors from domain models, and the Graphical Editing Framework (GEF) for adding graphical editing capabilities. I am spoiled with having lots of support from the platform.

Implementing similar applications on the web platform with Javascript seems like travelling back ten years in time. There are several popular frameworks that fix some of the really bad parts of Javascript and also add support for classes and components. But, you still have to write lots of boilerplate code to support things I am used to getting from the platform.

I am quite novice when it comes to web programming, but I do have some experience with the Google Web Toolkit (GWT). It has support for both EMF and GEF, and seems like a path for writing very rich and capable web applications. The drawback with GWT is that you are stuck with Java, which is lacking many of the more modern language features such as first-class support for functions. Also, there is a compile step to Javascript which makes edit-and-continue debugging hard to achieve.

Using GWT feels like driving an old reliable Volvo. It is safe and you don't have to worry crashing . But suddenly a new fresh-looking sports-car is passing you on the street. It is looking better, has nicer features and seems faster, but maybe not as crash-safe as a Volvo yet... In this analogy the faster car is the new Dart language that Google has been working hard on for more than a year. Dart is designed from ground up to support writing large, structured and performant web applications. The Dart VM engine it is already outperforming V8 in several key benchmarks. The goal according to Lars Bak's talk at Strange Loop is to make it at least twice as fast as V8. Maybe "V16" would be an appropriate name...

I think Dart may be the platform of choice for many developers with my background. Dart is not just a new language. It has great tooling with an Eclipse-based editor, new frameworks and a package manager "pub". The VM will initially only be available in Chrome, but Dart code can be compiled to Javascript, thus supporting all modern browsers.

Lars Bak said "speed is king!". If he can deliver that, I believe Dart has a big chance of being more than just a niche language.

2 comments:

  1. Grails (http://www.grails.org) is by far the most complete web framework I have used. It gives you a nice platform, a good Eclipse IDE and the plugin ecosystem is quite big. You can even mix Groovy and Java.

    ReplyDelete
    Replies
    1. Hi Henrik, thanks for the comment.

      We have been using Grails successfully for many products at our company, but they are more traditional web applications, i.e. more server-side logic. What I am talking about here is Rich Internet Applications where most of the logic is on the client.

      Delete