InfoWorld interview: Why Google Dart beats JavaScript

Although some call Dart a JavaScript killer, lead engineer says it brings discipline needed to create large-scale JavaScript apps

Google last month launched a Web programming language called Dart intended to address the shortcomings of JavaScript, and some have even called it a JavaScript killer. Accommodating large programs and team-based development, Dart is object-oriented and uses a virtual machine. InfoWorld recently interviewed Lars Bak, the lead software engineer for Dart, to better understand Google's intentions for the new language.

InfoWorld: Please explain the intent behind Google Dart, and is it a JavaScript killer, which it has been called?

Bak: I think it's an exaggeration. What we are trying to do here is make sure that developers have an alternative. In particular, we are trying to target with Dart application developers who are building large applications. JavaScript is a great language for simple Web applications, but as you grow the application, it gets harder and harder to keep the structure of the program in JavaScript. Dart is basically designed to [be] a programming language that will suit big applications well, and it will support program development where you have multiple teams working on the same source base.

[ Dart hits a bull's-eye for Web developers, InfoWorld columnist Neil McAllister says. | Peter Wayner reveals what's hot in scripting languages. | Subscribe to InfoWorld's Developer World newsletter for the key news and insights on software development. ]

InfoWorld: Is that what you mean by Dart being a language for structured Web programming?

Bak: It is. You can write small applications in Dart, but as the applications scale, you can start adding types to your programs, and that really specifies a programmer's intent. So if you make a module, you can see exactly how you're supposed to use the module based on the types you have specified in the interface and you can also check that in Dart. If you really have big teams working on the same source space, this actually makes a lot of sense.

InfoWorld: What is the benefit of Dart running on both clients and servers?

Bak: It's like any other language that runs on both sides. You can decide late in the process whether you want the code to be running on the server or in the client. You have to bear in mind that if you are writing Web applications, clients are very different. You have a Web browser on a desktop, which is very powerful, and you can put a lot of logic on the client side. But if you run a mobile phone, which also has a Web browser, you often want to off-load some of that code on the server side. If the application, both on the server side and the client side, is written in the same language, you have the option of deciding where the code should execute.

InfoWorld: I understand that Dart actually compiles to JavaScript code. Why not just use JavaScript then?

Bak: Well, because we have something else. We have a Dart virtual machine developed for the language that gives faster performance and better startup time. One of the problems in my mind with JavaScript is if you have a big application, it takes a long time to start the Web application using JavaScript. If you would have used a Dart VM, we have an infrastructure called snapshotting that will allow an application to start 10 times faster. What we can see is Web applications are getting larger and larger, and as they grow bigger, startup performance is very important.

InfoWorld: How hard is it going to be for developers to learn the Dart language?

Bak: We have been very careful when designing the language so that if you know JavaScript and if you know a class-based language like Java or C#, you should be able to be productive within a day. It has been designed exactly to be very unsurprising to JavaScript and C# programmers.

1 2 Page
Mobile Security Insider: iOS vs. Android vs. BlackBerry vs. Windows Phone
Recommended
Join the discussion
Be the first to comment on this article. Our Commenting Policies