Announcing Dart 2: Optimized for Client-Side Development

Today, we’re announcing Dart 2, a reboot of the language to embrace our vision of Dart: as a language uniquely optimized for client-side development for web and mobile.
With Dart 2, we’ve dramatically strengthened and streamlined the type system, cleaned up the syntax, and rebuilt much of the developer tool chain from the ground up to make mobile and web development more enjoyable and productive. Dart 2 also incorporates lessons learned from early adopters of the language including Flutter, AdWords, and AdSense, as well as thousands of improvements big and small in response to customer feedback.
Dart’s Core Tenets
Before we talk more about the advances in Dart 2, it’s worth identifying why we believe Dart is well positioned for the needs of client-side developers.
In addition to the attributes necessary for a modern, general purpose language, client-side development benefits from a language that is:
- Productive. Syntax must be clear and concise, tooling simple, and dev cycles near-instant and on-device.
- Fast. Runtime performance and startup must be great and predictable even on small mobile devices.
- Portable. Client developers have to think about three platforms today: iOS, Android, and Web. The language needs to work well on all of them.
- Approachable. The language can’t stray too far from the familiar if it wishes to be relevant for millions of developers.
- Reactive. A reactive style of programming should be supported by the language.
Dart has been used to ship many high-quality, mission-critical applications on the web, iOS, and Android at Google and elsewhere and is a great fit for mobile and web development:
- Dart increases developer velocity because it has a clear, succinct syntax and is able to run on a VM with a JIT compiler. The latter allows for stateful hot reload during mobile development, resulting in super fast dev cycles, where you can edit code, compile and replace in the running app on the device.
- With its ability to efficiently compile to native code ahead of time, Dart provides predictable, high performance and fast startup on mobile devices.
- Dart supports compilation to native code (ARM, x86, etc.) for fast mobile performance as well as transpilation to efficient JavaScript for the web.
- Dart is approachable to many existing developers, thanks to its unsurprising object-oriented aspects and syntax that — according to our users— allows any C++, C#, Objective-C, or Java developer to be productive in a matter of days.
- Dart works well for reactive programming with its battle-hardened core libraries, including streams and futures; it also has great support for managing short-lived objects through its fast generational garbage collector.
Dart 2: Better Client-Side Development
In Dart 2, we’ve taken further steps to solidify Dart as a great language for client-side development. In particular, we’ve added several new features including strong typing and improving how UI is defined as code.
Strong, Sound Typing
The teams behind AdWords and AdSense have built some of Google’s largest and most advanced web apps with Dart to manage the ads that are bringing in a large share of Google’s revenue. From working closely with these teams, we identified a big opportunity to strengthen Dart’s type system. This helps Dart developers catch bugs earlier in the development process, better scale to apps built by large teams, and increase overall code quality.
This isn’t unique, of course. In the broader web ecosystem, there’s also a growing trend towards adding type annotations to JavaScript. For example, TypeScript and Flow both extend JavaScript with type annotations and inference to improve the ability to analyze code.
In the small example below, Dart 2’s type inference helps uncover a somewhat subtle error and as result, helps improve overall code quality.





