Google Dart 3 Adds Record Support
Written by Kay Ewbank   
Thursday, 25 May 2023

Dart 3 has been released with support for records, patterns and class modifiers. The new release is also a fully sound, null safe language.

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

The move to become a fully sound null safe language has been achieved by major changes including the removal of several historical Dart language and SDK artifacts, including removing support for running without sound null safety. Null safety was introduced in Dart 2.12 to help developers avoid null errors, a class of bugs that are often hard to spot.

The move to 100% null safety in Dart means developers can trust that if a type says a value isn't null, then it never can be null. In addition to avoiding null pointer exceptions, it also allows Dart's compilers and runtimes to optimize code in ways it couldn't without null safety.

The new version also has new support for structured data with records. Originally, a Dart function could only return a single value, and developers who wanted to return multiple values had to either package these into other data types such as maps or lists or to define new classes that could hold the values. The new records are value types that look like list literals but use parentheses instead of brackets. Records can be used for function return values, can be stored in variables, put into lists, or hold other records.

Other improvements in the new release include pattern matching and class modifiers. Pattern matching can be used to decouple a record into its constituent types, while class modifiers let API authors support only a specific set of capabilities.

Dart 3 is available now.

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


.NET 9 Released
18/11/2024

.NET 9 has been released with a number of performance improvements and new features designed to help developers use AI.



Ursina - A Game Engine Powered by Python
08/11/2024

Ursina is a new open source game engine in which you can code any type of game in Python, be it 2-D, 3-D, an application, a visualization, you name it.


More News

espbook

 

Comments




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

Last Updated ( Thursday, 25 May 2023 )