Dart 2.2 arrives with a new set literal language feature and faster native code

Share
  • February 27, 2019

Dart is back with a new stable release!

Dart 2.2 is an incremental update to Dart 2 and it brings some significant improvements including enhanced performance of AOT-compiled code and more.

Let’s have a closer look.

The highlights

Faster AOT-compiled code –  improved AOT performance by 11–16% on microbenchmarks at the cost of a ~1% increase in code size. Optimized AOT code is now able to call the destination directly using a PC-relative call, using the program counter.

Extension of literals to support sets – You can now initialize a set and make it const using a convenient new syntax: const Set currencies = {'EUR', 'USD', 'JPY'};. Head over the updated Dart 2.2 language tour for further details on how to use set literals.

Building new language features with the Dart 2 Common Front-End (CFE) – You can now implement set literals initially as a CFE-only feature. The back ends could use the CFE implementation initially and later develop their own native support independently of the initial launch of the feature. This allowed backends to postpone their native support until the performance aspects of this feature were better understood.

New language repository – The language specification source was moved to a new repository. Also,  continuous integration was added to ensure a rolling draft specification is generated in PDF format as the specification for future versions of the Dart language is evolving. Both the 2.2 and rolling Dart 2.x specifications are now available.

Check out the medium post to find out more information on this release or head over to the Dart Language Specification repository for the detailed features.

SEE ALSO: Dart meets Kotlin? kt.dart ports the Kotlin Standard Library

Getting started

You can find Dart 2.2 available for download in the Dart SDK Archive.

If you are working with Flutter, Dart 2.2 is already included. Keep in mind that the latest Flutter release 1.2 will report Dart 2.1.2 which has the same features as Dart 2.2.

The post Dart 2.2 arrives with a new set literal language feature and faster native code appeared first on JAXenter.

Source : JAXenter