BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

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

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

Leia em Português

This item in japanese

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.

Rate this Article

Adoption
Style

BT