BT

Google Dart Language and Tools Announced - Dynamic Language, Optionally Typed, Familiar Syntax

by Werner Schuster on Oct 10, 2011 |

Live from GotoCon Aarhus 2011 keynote with Lars Bak and Gilad Bracha. 

Google's Lars Bak (creator of, among other things, Chrome's V8 Javascript engine) and Gilad Bracha (former Java steward, creator of the Newspeak language) gave GotoCon Aarhus' keynote and used it to announce a new language and tools for the web. 

First off: the language comes as a technology preview, it is not yet in Chrome, it comes with syntax familiar to Javascript developers, Erlang-style/Actor-style concurrency. Comes with support to write applications for the iPad. Update: clarification: the demoed iPad version was Dart code cross compiled to Javascript and executed 

Characteristics:

  • Class-based single inheritance with interfaces
  • Optional static types
  • Reified Generics
  • Real lexical scoping
  • single threaded
  • Familiar syntax, Javascrpt-like

Syntactic features

  • class based
  • operator overloading
  • String interpolation "Hello ${foo}"
  • lambda syntax: (x) => x

Types in Dart:

  • optional
  • type annotations have no influence on compilation or execution: if arguments or variables have a wrong type, the code still works if the code is correct. The tooling will issue warnings.
  • reified Generics

Interfaces:

  • Interfaces with Factory implementations
  • interface person factory PersonFactory
  • interfaces have constructors; call to it will go to factory class declared in Interface

Concurrency with Isolates:

  • each Isolate is a conceptual process, Erlang-style
  • no sharing
  • communication via message passing
  • isolates have one or more ports
  • Isolates can run in parallel 

The language is not done yet, and the team is looking for input. The language is currently not in Chrome.

Dart execution:

  • DartC compiles Dart to plain Javascript
  • a dedicated Dart VM can execute Dart
  • a third option: Dart comes with tools to create an image of the heap of an application and package it into an optimized format which can be loaded nearly instantly, reminiscient of Smalltalk's image system.

Tools:

  • based on Eclipse source but not an Eclipse plugin Update: clarification: this statement was made in the keynote, however the editor and tools are indeed Eclipse plugins. 
  • auto completion support with types 

A technology preview version of Dart and the tools is available for download now,  and at the Google Code Dart project.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

OPA by Cédric S

Infoq presented OPA some weeks ago ( www.infoq.com/articles/Opa ), which sounds like Draft for the client side, but which also takes care of all the server (and communication) stuff!

Sounds cool by Richard Hightower

This actually sounds pretty cool and useful. Sort of like a stripped down version of Java with reified generics and closures (lambda) or a less strange version of JavaScripts with some type support.

Now what would be cooler is if you could program GWT, and Android devices with it, and if it had a version that worked on the JVM and integrated with JVM for Java server side integration.

Oh yeah.. and a Dart VM that runs in the browser because who wants to actually compile to JavaScript going forward (I mean only to support legacy browsers). If only they controlled an emerging browser. Oh wait.

Also if it ran in Android to develop native Android apps then... umm.. err... might take some of the sting out of the lawsuit too.

Also HTML 5, Android, iOS abstraction layer for location, local storage, websockets etc. Develop native apps that can easily be ported to a browser app and say a mobile OS or two. Possibilities are endless. How does this compare to CoffeeScript (syntax wise)?

On more of a random opinion note. The syntax seemed a lot like Java minus the generic warts and plus lambda. Hmmm....

What is it missing? Anyone know if they have plans to use it for Android development? Random thoughts minus research.

Dead for Other Stuffs by Doug Ly

Does this smell like dead for other stuff invented to ease the pain of developing in JS?
To name a few:
1. GWT (java -> JS, which I don't even think Google would use in their flagship projects)
2. CoffeeScript: who need this when you can run directly (or thru a native plugin) in the browser
3. Other JS frameworks that make JS less suck: Prototype for example
4. Tools that allow running JS at server side: Node.js, Mozilla's Rhino

I really the initiative from Google. At the same time, they have so many similar things going on trying to resolve the same thing: GWT, Native Client (with Pepper JS interface). At the end: are they trying to make an ActiveX plugin architecture?

Image of the Heap by Lyndon Samson

Is this to get around the AppStore TOC?

Re: Image of the Heap by Richard Hightower

Maybe. But that has to be a fools errand right? They could just change their TOC. right?
I have never used Smalltalk beyond demo apps. How useful is this feature with Smalltalk?

compiles Dart to plain Javascript by Ma Karl

"DartC compiles Dart to plain Javascript"
Dart is a new language or just a simple compiler??

Re: Image of the Heap by Faisal Waris

the main benefit, in this case, would be faster loading of an app.

Instead of obtaining scripts over the network and compiling them on the fly, it would be much faster to 'deserialize' an image into memory. For large apps ('docs') image loading should be significantly faster.

I believe this is one of the issues with javascript today especially if the server/network is overloaded.

[I don't know anything about the TOC. Maybe it does the same thing]

Re: Sounds cool by Russell Leggett

They are planning on integrating into the browser, and I think they're hoping others will do the same. As far as your other stuff, I would be very surprised if this didn't show up as a way of unifying android and web dev. Perhaps even the missing link between Android and ChromeOS.

Its funny - between Dart and NaCl, I feel like instead of Android becoming more like Chrome and web standards, Chrome is becoming more like Android.

Google can do even better than Dart by Alex Tatiyants

Dart is great, but Google can do even better: tatiyants.com/?p=1229

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

10 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT