Google debuts Dart, a new programming language for the web

Early today, Google started showing off Dart, a new language for structured web programming.

This language is, as a product of the 21st century, designed with modern web browsers and modern devices — from tablets to servers — in mind.

According to a reportedly leaked email from last year, the language “aims to maintain the dynamic nature of JavaScript but have a better performance profile and be amenable to tooling for large projects.”

Dart is said to be a replacement for JavaScript (or CoffeeScript, or ClojureScript). It’s class-based, and it was developed to bring more simplicity, efficiency and scalability to the table. Key minds behind the project include Google programmers Lars Bak, Gilad Bracha and Kasper Lund.

Bak writes on the Google Code blog that applications written in Dart can be executed on a native virtual machine, or can be translated to JavaScript and executed on a JavaScript engine.

In addition to the language itself, Google is also releasing basic tools for checking, compiling and running Dart code as well as libraries.

“Dart targets a wide range of development scenarios from a one-person project without much structure to a large-scale project needing formal types in the code to state programmer intent,” wries Bak. “To support this wide range of projects, Dart has optional types; this means you can start coding without types and add them later as needed. We believe Dart will be great for writing large web applications.”

If you’ve done programming before (in any number of common programming languages), the syntax is simple enough to pick up and will look and feel at least somewhat familiar.

Google engineer Bob Nystrom, who worked on the project, took to Reddit to answer questions about the new language.

“Its syntax, while uninspiring, is familiar and easy to pick up for millions of programmers,” Nystrom wrote. “I wish it had a little more razzle dazzle but I can’t deny that literally on my first day of writing Dart code, I was productive in it.”

He noted that the language is based on the “workhorse features” classes and first-class functions. “I know it’s cool to hate on classes these days,” he noted, “but it’s worth remembering how much of the world’s successful code is written in a class-based language. And, of course, closures are delightful.”

The rest of Nystrom’s Reddit thread acts as a pretty informative FAQ for Dart.

Googler William Shields puts the language in perspective with some words about Google Web Tools (GWT) in a thread on Hacker News.

“What’s simple in JavaScript with anonymous objects and duck typing doesn’t quite gel with Java, so you’ve had to do things like use JSNI for edge cases. Google has some incredibly large and ocmplex JavaScript apps (e.g., GMail). While GMail isn’t written in GWT, GWT is aimed at that kind of application with deferred binding and the benefits of static type analysis.

“What if you took that expertise… to produce a language that could run on the server, run in the browser (for browsers that support that) and compile to Javascript (for browsers that don’t)?”

Shields concludes that the Java-reminiscent syntax is “no surprise” and that he expects to see a JVM implementation soon “that will then leverage all the existing Java libraries.”

One of the questions Nystrom remarked on was whether Google would be able to support a sustained committment to yet another programming language. After all, the company is still in a very formative and critical stage with Google+ and is supporting a good number open-source programming projects, including another programming language, Go.

Nystrom says questioning Google’s committment “is a valid concern. It was a concern of mine when I joined the team. I don’t know what will happen, but what I can say is Google’s already put more resources on it than I was expecting. Gilad [Bracha] doesn’t f-ck around, and he came to Google to work on Dart. I don’t think he’d be happy if it fizzled out.”

0 comments