Skip to main content

Posts

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Dart 1.22: Faster tools, assert messages, covariant overrides

Dart 1.22 is now available. It introduces a sync/async union type, assert messages, covariant parameter overrides, and much more. Tool startup is now much faster. Get it now! Faster tool startup We have switched to using application snapshots for running our SDK tools like dart2js, analyzer, and pub. This improves startup performance. See the AOT compiling talk  at Dart Dev Summit 2016 for more information. Information about how to use application snapshots can be found in the SDK wiki . Here are the improved performance numbers we see with the switch. Assert messages The fail-fast  principle is crucial for building high-quality software, and assert  is the simplest way to fail fast. But until now, it wasn’t possible to attach messages to asserts, so if you wanted to make your error useful, you were forced to throw a full exception. Like this: num measureDistance(List waypoints) { if (waypoints.any((point) => point.isInaccessible)) { throw new Ar...

Sound Dart and strong mode

As of the 1.19 release, Dart supports an optional mode, called strong mode , that supports stronger static typing. Strong mode helps you find bugs sooner and contributes to making Dart a sound language. To learn more about using strong mode to enable soundness, including the how, the why, and fixes for common problems you might encounter, see: Sound Dart How and why to write sound Dart code, and how to use strong mode to enable soundness. Sound Dart: FAQ A list of common questions for those who are interested in stronger static typing. Sound Dart: Fixing Common Problems How to fix errors and warnings you may encounter when writing sound Dart code.

Dart in 2016: The fastest growing programming language at Google, 2nd fastest growing in TIOBE Index

Dart was the fastest growing programming language at Google in 2016 with millions of lines of code written. It also made it to TIOBE Index Top 20 this month (see TIOBE's methodology ). It takes time to build something as ambitious as Dart and, in some ways, Dart is still in its infancy. But we're glad the hard work is starting to pay off. Many thanks to our amazing community! We're going to celebrate by ... releasing 1.22 next week (as per our usual 6 week release schedule).

Enhancing the Flutter developer experience

At the Dart Developer Summit we introduced our fast and powerful Flutter developer experience. But our ambitions don’t stop here, so we have been hard at work developing several updates that further improve the experience. Faster startup during development Hot reload means you only have to launch your app once; after that changes are simply reloaded into the running app. But even that initial launch should be really fast. Previously we used a loader application to bootstrap the device with your application sources. Thanks to recent improvements made to the reload engine inside the VM this is no longer necessary and your application will be booted immediately, and you will see the real launch experience of your app. IntelliJ improvements We have published an update to our IntelliJ plugin, version 0.1.6 that has several exciting changes : Launching the app with hot reload support (see details below) A new flutter action pane has been added on flutter.yaml files (see de...

Dart 1.21: Generic Method Syntax

Dart 1.21 is now available. It introduces support for generic method syntax along with a few popular convenience features. Get it now! Generic method syntax Until now, Dart's generic support was limited to classes, such as List<T> . Dart 1.21 introduces syntax allowing type arguments on methods and functions.    T first<T>(List<T> ts) {      return ts.length == 0 ? throw new ArgumentError('Empty list!') : ts[0];    } Note the return type, T . This enables call sites to preserve type information from arguments. Try to write the same function without a type argument, and you'll see that the return type must be Object – there is no other way we can make it work on all lists. For more examples, check out the Using Generic Methods article . For even more details, the informal specification is the place to go. We've had generic methods and functions for a while in strong mode . 1.21 introduces support for generic method s...

StageXL 1.0: a chat with Bernhard Pichler

To contribute to the celebration of the recent 1.0 launch of StageXL , we had a chat with Bernhard Pichler to learn more. Here we go. --- First and foremost huge congrats on the 1.0 launch! People are already raving over it on Hacker News and Reddit . This is really a great accomplishment. I was wondering if you could start by telling us a bit about who you are? Thanks. Sure. My name is Bernhard Pichler, I'm 42 years old and I'm from Austria - you know Sound Of Music but no kangaroos. In my day job I work as a developer for a company in the gaming and betting industry. Nowadays I mostly do stuff on the backend but I used to work on the frontend in the past. That's why I still love to do computer graphics and why I work on StageXL in my spare time. How would you explain in less than 54 words, what StageXL is?  StageXL is a 2D rendering engine mainly built for casual games. Games like Farmville or Bejeweled are good examples. More people are playing this ki...

Dart Strong Mode and ahead-of-time compilation

Dart is increasingly being used as a cross platform language, and on most of these platforms ahead-of-time (AOT) compilation is a key part of the development and deployment story. The dynamic nature of Dart limits the effectiveness of ahead-of-time compilation, particularly as applications scale up in size. We therefore designed Strong Mode Dart  to allow ahead-of-time compilers to generate better code by taking full advantage of the type information that programmers write. While the initial goal of Strong Mode was to enable better ahead-of-time compilation, we've also seen strong uptake of Strong Mode from users who just like the stronger static checking because of it’s ability to make writing, reading, and refactoring Dart code more reliable. The recent talk from the Dart Developer Summit gives an overview of Strong Mode: what it is, why having a sound type system is useful, and how it benefits developers by making their IDE experience better, and their errors more ...