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


Gender Differences In Coding Style
13/11/2024

A novel investigation into the gender gap between men and women regarding coding ability was undertaken by Dr Siân Brooke. Her conclusion? There is a difference in the Python code [ ... ]



Google Intensive AI Course - Free On Kaggle
05/11/2024

Google is offering a 5-Day Gen AI Intensive Course designed to equip data scientists with the knowledge and skills to tackle generative AI projects with confidence. It runs on the Kaggle platform from [ ... ]


More News

espbook

 

Comments




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