Skip to main content


Showing posts from 2014

Enums and Async primitives in Dart

Support for enums, async, and deferred loading are now officially part of the 2nd revision of the Ecma-408 standard, the Dart Programming Language Specification. The second revision was approved last week at the Ecma General Assembly.

You can find more information about using the new features in our language tour on

Enumerations (enum) Asynchrony (async, await, and more)Deferred loading (import ... deferred as)Enums

Enums help developers express clear intent with minimal code, and help tools catch potential bugs. Here is an example of an enumeration of form states:


Tools can even warn developers if they omit an enum value from a switch statement, which helps identify potential bugs.


Dart has always had strong support for asynchronous programming, with core library features such as Future and Stream. Now, with the new language primitives async and await, asynchronous code is much easier to read and write.

The following code i…

Dart 1.8: library improvements and experimental support for enums

Would you like to try out Dart’s upcoming support for enums? In Dart Editor under Tools > Preferences > Experimental you can “Enable Enums Support” and start experimenting with code like:

With Dart 1.8, a number of library improvements have also landed.  In dart:collection, SplayTree added toSet() method, and in dart:convert a JsonUtf8Encoder class was added. In dart:core, the following three things were added: New properties and constructors for RangeErrorA new IndexError class - used by the RangeError.index constructorOptional start and end arguments for the String.fromCharCodes constructor.In dart:io we added support for the ALPN extension of the TLS secure networking protocol for Client and Server. For a summary of these and others changes see the release notes. You can download Dart 1.8 from the Download Dart page. If you are running the Dart Editor, you can update by checking "About Dart Editor". Check out the Dart support page for information on getting help, fil…

Running Dart server applications on Google Cloud Platform

Today you can develop and deploy Dart server applications that run on the Google App Engine Managed VMs beta.The productivity of the Dart language and libraries are a great fit for server applications. You get the competitive performance of the Dart VM while leveraging powerful tools like Observatory–all while easily sharing code with your browser application.Now you can try Dart on Google App Engine, which lets you build and run applications on Google’s infrastructure. App Engine applications are easy to build, easy to maintain, and easy to scale as your traffic and data storage needs change. With App Engine, there are no servers for you to maintain. You simply upload your application and it’s ready to go.Managed VMs extend App Engine to support user-defined custom runtimes. The Dart team is building on custom runtimes to allow you to easily develop and deploy Dart server applications that run on Google’s infrastructure.Once you have set up your local development environment, you can…

WebStorm 9 released with improved Dart support

Today, JetBrains announced WebStorm 9, an update to their powerful web development editor. Highlights for the Dart developer include: pub serve support, improved isolates debugging, Observatory support, new syntax support, and more.

WebStorm 9 now launches pub serve, Dart's development server, when the developer runs a Dart web app. Pub serve takes care of generating assets, compiling to JavaScript, and more.

Developing and debugging apps that run multiple computations in parallel is now easier, thanks to the new ability to set breakpoints inside of isolates.

For deep insight into your app running on the Dart VM, you can now open the Observatory directly from WebStorm 9. Use the Observatory to learn how memory is used, where CPU time is spent, and more.

It's now easier to debug apps that use collections (which is every app), thanks to the debugger's logical view of maps and lists. Developers now see the logical data structure instead of internal implementation details.


Dart 1.7: easily share and use command-line applications built with Dart

The Dart language, libraries, and runtime make it easy to create command-line applications. In fact, all of the core tools in the Dart SDK – dart2js, pub, and dartanalyzer – are written in Dart. We wanted to allow developers to easily get their own Dart scripts and command-line apps into users' hands. With Dart 1.7, users now have an easy way to install and run scripts built with Dart, making first-class command-line Dart apps a reality.

Developers can specify executables (Dart scripts) in their pub package, which are made available to a user when the package is installed.


$> git clone
$> cd my_cool_app
$> pub install
$> dart bin/my_cool_app.dart


$> pub global activate my_cool_app
$> my_cool_app

Dart 1.7 also includes improvements to our code isolation models. You can now launch isolates with a different package root than the host application, allowing for composition of Dart applications with different dependencie…

Dart plugin for Sublime updated with many new features

Many of our developers enjoy using lightweight text editors, but still want to use features traditionally found in powerful IDEs. Today, in partnership with Guillermo López-Anglada, lead developer of the Dart plugin for Sublime, we are announcing many new features to help Dart developers stay productive in Sublime Text 3.

With the Dart plugin, Sublime understands your Dart code and projects. Dart code is syntax highlighted, with support for the latest language keywords like async/await and deferred. To provide you with feedback on code quality, the plugin displays errors and warnings from static analysis.
You can run web applications, command-line scripts, and servers without leaving Sublime. The Dart plugin starts and manages pub serve, Dart's development server, making it easy to launch your web app into Dartium or any browser.

Integration with various Dart SDK tools is now more complete. Keep your Dart code in sync with the Dart Style Guide with the new Format source code feature.…

Google Elections Launches New App Built with Dart, Polymer

This past weekend, the Google Elections team introduced their Elections Explorer for Brazil: a live, real-time election results experience for the presidential, gubernatorial, senate, and chamber races in Brazil. This is the Google Elections team's second app built with Dart, and their first to use Polymer.

The Google Elections team is happy with their experience. They write:

"We love writing Dart because it's fast, compact, and sane. Great tools and a readable language give us the confidence we need to move quickly. But adding Polymer to the mix is pure gold. After years of writing code for the web, this was the first time I've felt like I'm working with a real platform. We threw away tons of the boilerplate we've built up over time and just focused on the app itself. This was awesome."

Sean Diamond, new to our team this year, said, "Being new to web development, but having done years of UI development on native platforms, writing Polymer with Dart m…

Dart launches support for Homebrew

Developers can now easily install and update Dart SDK and Dartium on Macs with Homebrew, a popular package manager for Mac OS X. Both the stable SDK and (for the more adventurous) the dev channel SDK are available via Homebrew.

It's easy to get started. After you install Homebrew, run these commands to install the stable channel Dart SDK and Dartium:

  brew tap dart-lang/dart
  brew install dart
  brew install dartium # if you build Dart client apps
When there is a new build of the SDK or Dartium, run these commands to stay up to date:
  brew update
  brew upgrade dart
  brew upgrade dartium
Use Homebrew if you build server-side Dart apps, or you are not using Dart Editor (for example, if you use WebStorm or Sublime). To download Dart Editor, you can continue to use the download page.
We hope our support for Homebrew makes it easy for our Mac developers to stay on the latest versions of the Dart SDK. Thanks to the Homebrew developers for answering our questions along the way. We look forw…

New Google APIs Client Libraries for Dart help Dart apps use Google services

We are always working on providing new APIs for Dart. If you have been using Google services from Dart, we are happy to say that the Dart Team is now supporting a client library for accessing a set of APIs to Google services.

Most Google services have an API described by the Google Discovery Service. This includes both Apps APIs (such as Gmail and Drive) and Cloud APIs (such as Cloud Datastore and Cloud Storage).

Based on previous work by GDEs Adam Singer and Gerwin Sturm, the Dart Team has built an API generator to create Dart client libraries enabling access to Google services. We recently published the following two packages on


The googleapis package contains all the APIs that are available in a stable version. The googleapis_beta package contains the APIs that are currently in beta and possible only available through a Limited Preview program. We will be updating these packages on a monthly basis to ensure that they provide access to new …

Docker images for Dart now available

Developers increasingly want to use the same language and business logic on the client and the server to reduce risk and complexity. To help developers easily build and deploy end-to-end Dart apps, we are happy to announce ready-to-use Docker images for Dart. This expands our Docker usage further beyond the recently announced Docker support in Google App Engine. There are now three Dart-related images on for you to use: dart, dart-runtime and dart-hello, which uses the same naming scheme as the corresponding Node, Python and Go images already offered.

The image google/dart adds the Dart SDK to google/debian Debian wheezy image. Running Dart in a container is now as simple as this:

  $ docker run -i -t google/dart /usr/bin/dart --version

The image google/dart-runtime inherits from google/dart, and provides a convenient way to run a Dart server application using a one line Dockerfile. To inherit from google/dart-runtime, your server application requires the following layou…

Dart 1.6 adds support for deferred loading

Dart makes creating complex applications easy, but large code size can negatively affect startup time. Dart 1.6 added support for deferred loading, which allows developers to load libraries only when needed, allowing for quicker load times and a better user experience. The Dart site has an article describing how to use deferred loading in your application.
Dart 1.6 also contains a number improvements which improve the security of server applications. The Uri class is now more strict about malformed data and HttpServer now defaults to sending best-practices headers to help protect your application and your users.
For summary these and others changes see the release notes.
You can download Dart 1.6 from the Download Dart page. If you are running the Dart Editor, you can update by checking "About Dart Editor". Check out the Dart support page for information on getting help, filing issues, contributing to the project.

Ecma approves the 1st edition of the Dart language specification

At its 107th General Assembly last week, Ecma approved the first edition of the Dart language specification. Dart is now an official Ecma standard and the specification is made available as Ecma-408 standard.

We are very happy with the TC52 contributions from the community and the exciting language work on Enums, Deferred Loading and Async lying ahead.

We encourage everyone interested in the evolution of Dart to join Ecma and contribute to the TC52 work. The next meeting will be held on September 16, 2014 in Zürich, Switzerland.

Dart 1.5 makes it easier to develop for the mobile web

It’s important for web experiences to work great on mobile devices. The latest release of the Dart includes a development version of Dartium – Chrome with the Dart Runtime – which runs on Android devices. We’ve also updated the Dart Editor to support debugging mobile web apps written in Dart. You can set breakpoints and debug exceptions with Dart web apps running on a device with the same development flow that exists on your development machine. Check out the documentation to get started.
The Dart 1.5 release cycle was short – just four weeks – but we are excited to continue delivering great improvements to our platform and tools. You can see a summary of the updates in the release notes.

We have also released an update to the Dart Polymer package and shipped two sets of new Polymer elements. core_elements gives Dart developers access to all Polymers infrastructure components. paper_elements contains Polymer elements that follow the material design pattern that was announced at Googl…

Dart at Google I/O 2014

Google I/O 2014 is right around the corner. This year, we’re thrilled to have more presentations about using Dart than ever before at I/O.

If you’re keen to learn more about what the Dart team and Dart users have in store for you, be sure to either check out the online schedule or install the I/O app. Pick the topic “Dart” and you’ll be taken straight to the many Dart-related events at I/O.

If you’re attending I/O this year, please drop by and say "Hi" at the Dart booth. Many Dart engineers will be at I/O, answering questions and helping you with your apps.

For those of you not able to join us in San Francisco, be sure to tune into the live stream, join a local I/O extended near you, or watch the sessions on the Google Developers YouTube channel. If you can't wait, be sure to subscribe to the Google Developers YouTube channel already now for additional Dart videos produced just for I/O, including previews of some new highly requested features.

Dart 1.4 Brings Deep Visibility to Run Applications

It’s much easier to improve something if you can measure it. With Dart SDK 1.4, we are announcing Observatory: a comprehensive set of tools for understanding, measuring, and improving your Dart code.

As the documentation explains:
Observatory allows you to peek inside a running Dart virtual machine (VM) on demand and provides live, immediate reporting of data. You can use it to browse most aspects of an application.

The Observatory provides information on garbage collection, the instance count for all in-memory objects by their type, line-by-line code coverage, and even evaluation of arbitrary expressions. It will continue to evolve and improve in future releases. Take a look at the documentation and let us know if you have issues or suggestions.
Dart 1.4 also includes a number of other fixes, additions and improvements, including:
The dartanalyzer command line tool is now 100% Dart and runs without Java. Using dartanalyzer directly or via other tools requires only the Dart VM. File …

Dart support for Internet Explorer

Dart v1.5, scheduled for late June, will be the last Dart release to support Internet Explorer 9. Dart will continue to support the latest releases of Firefox, Chrome, and Safari, as well as the two most recent releases of Internet Explorer – currently IE10 & IE11.

The factors we considered:

Most measures show IE9 usage is less than half of IE10 and IE11 combined.The same measures often show IE9 usage trailing IE8.A number of Google properties, including Google Apps, have ended support for IE9.The Polymer project limits support to IE10+.
While we regret the impact to developers who would like to continue to support IE9, we are excited about the improvements this change will allow. For example, releases after Dart v1.5 will be able to use typed arrays across all of our libraries. Typed arrays are a web API for efficient access to raw binary data. Expanded use will help simplify and optimize the Dart SDK and enable developers to build faster and better experiences.

Please post on our…

Dart plugin for IntelliJ IDEA and WebStorm

The Dart plugin for IntelliJ IDEA-based IDEs, has a new release with important enhancements. Notably, the plugin is now compatible with all versions of IntelliJ IDEA, including IDEA 13.1 Community Edition—the free open-source version of IntelliJ IDEA. This means you can get a version of the IntelliJ IDE with Dart auto-completion, code validation, package management, quick fixes, navigation, and full-featured command-line app debugging for free!

Pub Integration The Dart plugin features rich pub integration. The pub tool commands get, upgrade, and build are available by context-clicking the pubspec.yaml file.

Configuring the SDK When creating a new Dart project with the project wizard or starting a Dart project in the IDE for the first time, you’re asked to set up the path to Dart SDK. If the SDK was downloaded together with Dart Editor, the path to Dartium is added automatically. You can configure command-line options and a custom user data directory for Dartium.

With the path to Dar…

Dart 1.3 dramatically improves server-side performance

With Dart SDK 1.3, we’ve improved performance of async code running in the Dart VM and made substantial improvements to dart:io. This results in some of our experimental HTTP benchmarks now running at more than twice the speed of the previous release. We continuously track these benchmarks on the new Dart I/O performance page.

In the Dart Editor, “Run as JavaScript” now uses pub serve, which serves your web app’s assets and does code transformations using a development server built into pub. This makes your development workflow faster and more streamlined.
For users of AngularDart we have other good news in store: the Dart Editor now has support for Angular code completions and improved Angular analysis and refactoring support. Building web apps using Dart and Angular just got even more productive!
You can download Dart 1.3 from the Download Dart page. If you are running the Dart Editor, you can update by checking "About Dart Editor". Don’t forget to tell us what you build w…

Dart 1.2 continues to improve developer experience

With the 1.2 release, the Dart team continues its commitment to regular, compatible updates to our core runtime and tools. This release includes improved debugging, faster networking, and Angular support in the Editor.

Debugging Dart applications is now easier. Breakpoints can now be set at local variable assignments. A number of bugs have also been addressed, including stepping through recursive functions and eliminating side effects of using the debugger.

The Dart core libraries continue to improve with a focus on performance. WebSocket throughput has increased by a factor of 15 since version 1.0. The speed of our core async primitives, Future and Stream, also improved by over 10%.

Angular support in the Editor has been greatly improved in this release. Search, navigation, and refactoring now understand Angular elements. A number of Angular-specific warnings have also been added.

Please see the Release Notes for a description of all changes. Dart 1.2 includes bug fixes, performance…

Standardizing Dart: 1st Ecma TC52 Meeting in March

Back in December, Ecma created a new technical committee named TC52 to publish a standard specification of the Dart language. The inaugural TC52 meeting takes place on March 12, 2014 in Mountain View, California. In addition to ratifying the current spec, the committee plans to address proposals for Enums and Deferred Loading. If time permits, we’ll initiate work on the broader set of features to be added for Dart 2.0.

TC52 would love to see contributions to the Dart language specification from many players in the industry. Please come and join the committee, it's not too late to get involved. For language requests in general, the issue tracker - - is a great place to start the discussion. The TC52 committee will pull from the issue tracker.
This official start of TC52 is an important step towards a future where Dart runs natively in web browsers. While Dart apps can already be fast when compiled to JavaScript, users can feel a true performance boost when the Dart VM is …

Dart 1.1 features up to 25% faster Javascript

Better performance, more features, and improved tools mark the 1.1 release of Dart. Just two months after the 1.0 release, this new release delivers a set of compatible updates that makes applications easier to develop and faster for end users.

Dart’s Javascript output continues to shine. Performance on the Richards benchmark is 25% better than the first release, making runtime comparable to the original JavaScript. Performance of the newest benchmark, FluidMotion, has doubled since November. Dart2js now generates Javascript that performs as well as, if not better than, the idiomatic Javascript equivalent.

While there’s a lot of focus on Dart for browser applications, there is also growing interest in Dart for server solutions. This release provides a number of enhancements for server-side Dart, including support for large files, file copying, process signal handlers, and terminal information. New in this release is support for UDP, which, for example, allows developers to write more ef…

New docs and samples for server-side and command-line Dart apps

The Dart team published new docs and samples showing how to write command-line and server-side apps with Dart. The Dart VM's dart:io library provides access to files, directories, sockets, web sockets, SSL, TCP, UDP, HTTP, and more. Community packages on provide higher-level frameworks and libraries.

The Command-Line Apps for Dart Programmer's Guide starts to collect resources for the new server-side and command-line Dart app developers. You'll find links to samples, API docs, community projects, tutorials, and more.

The new Command-Line Apps in Dart tutorial teaches you how to build command-line apps. Learn how to use stdin/stdout, command-line arguments, files and directories, and more.

For an in-depth look at how a Dart-based HTTP and Web sockets server is written, check out Walkthrough: Dartiverse Search. This chapter from Dart Up & Running shows how Dart is used for both the client and the server. Bonus: learn how you can connect to Github's A…