Google Introduces Dart With the Ultimate Goal to Replace JavaScript

Dart logo

In October 10th, 2011, Google unveiled its new web programming language Dart. The search giant described it as a "class-based optionally typed programming language for building web applications." Dart has a native virtual machine and can also be compiled into JavaScript, allowing it to run on current browser.

The project that was founded by Lars Bak and Kasper Lund is a class-based and object-oriented open-source language developed in-house by Google. It was first introduced at the GOTO conference in Aarhus. The goal of Dart is "ultimately to replace JavaScript as the lingua franca of web development on the open web platform".

Before than happens, in order to run in mainstream browsers, Dart relies on a source-to-source compiler to JavaScript. Google solved JavaScript performance issues by evolving Dart rather than extending JavaScript. Dart enables Google to build more complexity into client-side web applications.

Dart is an object-oriented language with C-style syntax that supports interfaces, abstract classes, generics, and optional typing. Dart's design goals are:

  • Create a structured yet flexible language for web programming.
  • Make Dart feel familiar and natural to programmers and thus easy to learn.
  • Ensure that Dart delivers high performance on all modern web browsers and environments ranging from small handheld devices to server-side execution.

The language comes with a set of basic libraries and tools for checking, compiling, and running Dart code.

There are three main ways to run Dart code: by compiling as JavaScript using the dart2js compiler, with the Dartium browser that include a Dart virtual machine (VM) and a bootstrap JavaScript file, or as a standalone with Dart VM.

Dart that runs in one of two modes ("checked mode" and "production mode") is typical of the ALGOL language family, alongside C, C#, Java, JavaScript, and others. Its syntax is adopted from Smalltalk and its mixins were influenced by Strongtalk and Ruby. It also borrows concepts from Erlang and Self.

Google hopes that Dart will replace JavaScript as the main built-in scripting language in web browsers. The design goals for the new language are said to include fixing many flaws from JavaScript, giving better performance, better support and improved security features.