Dart 3 Will Be Fully Sound And Null Safe
Written by Kay Ewbank   
Monday, 19 December 2022

The next version of Dart will be "a fully sound null safe language" according to the Dart development team, and in order to achieve this several historical Dart language and SDK artifacts are being removed, including removing support for running without sound null safety.

Dart is a client-optimized language designed to provide a way to create fast apps on any platform. It began life as an alternative to JavaScript that would be supported directly by browsers, but when this didn't work out it was redeveloped by Google as a better compiler. Dart is object-oriented and class-based with a C-style syntax.

dartlogo

Null safety was introduced in Dart 2.12 to help developers avoid null errors, a class of bugs that are often hard to spot. For Dart 3 the developers are pushing this even further. Until now the null safety support in the Dart language made variables non-nullable by default, and only allowing nulls when explicitly declared.

Version 3 of Dart will only support sound null safety, which guarantees that a non-nullable variable never contains a null value. Some pubspec files will stop resolving in Dart 3 and later, and any source code containing language markers will fail when you set the constraint to less than 2.12 (e.g. // @dart=2.9).

The Dart team says they believe that around 85% of all executions of flutter run use sound null safety at this time. Those developers who have apps or packages in the remaining 15% need to migrate before Dart 3 ships (expected around mid-2023). To help you achieve this the team has put together the following video:

 

Alongside the null safety change, some other "historical artifacts in the Dart language and core library APIs" are being removed, including the discontinued core library APIs, removing a historical syntax for default parameter values, and requiring tear-offs to be explicit.

There are some additions to Dart 3, including improved interoperability with other programming languages and new language features, but details of most of these are still under wraps.

 

dartlogo

More Information

Dart website

Related Articles

Dart 2.12 Released With FFI

Dart 2.6 Adds Native Linux Support

Dart 2.1 Is Smaller And Faster

Dart 2 Released With New Mobile Focus

Google's Dart Reborn As Cross Platform App Language

Dart Changes Course - No Longer To Be Native In Chrome

The Astonishing Rise Of Dart

Ecma Approves Dart

 

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Nobel Prize For Chemistry For AlphaFold
11/10/2024

The Royal Swedish Academy of Sciences has awarded a half share of the 2024 Nobel Prize For Chemistry to Demis Hassabis, CEO of Google DeepMind and his colleague John Jumper for "protein stru [ ... ]



Pulumi Envisions The Intelligent Cloud
18/09/2024

Today at PulumiUp, its 4th annual conference, Pulumi is announcing "Intelligent Cloud", its vision for AI-powered cloud infrastructure, and two new products, ESC GA and Insights 2.0.  


More News

kotlin book

 

Comments




or email your comment to: comments@i-programmer.info