The new version of Dart 2.12 has been released and arrives with Null Safety and FFI

Followed by the previous release of the new version of Flutter 2, Google also released the post (almost at the same time) of the launch of the new version programming language Darts 2.12, in which the development of the radically redesigned Dart 2 branch continues.

For those who are unfamiliar with Dart (originally called Dash) should know that this is an open source programming language, developed by Google.

About Dart

Dart is designed to offer better results through alternatives to some problems of JavaScript, despite the fact that in his presentation no explicit references were made to JavaScript. It is intended to be a simple tool for larger projects and to offer better security.

The point of Dart is not to replace JavaScript as the main web programming language in web browsers, but to offer a more modern alternative. The spirit of the language can be seen reflected in the statements of Lars Bak, Google software engineer, who defines Dart as a "structured but flexible language for Web programming"

Among the unique features Dart highlights the following:

  • Portable: that efficient compilers generate x86 and ARM machine code for devices and JavaScript optimized for the web. A wide range of targets are supported: mobile devices, desktop PCs, application backends, and more. An extensive set of libraries and packages provides consistent APIs that work across platforms, further reducing the cost of building true cross-platform applications.
  • Productive: the dart platform enables fast and iterative development both for native devices and for the web. And Dart offers rich constructs like isolates and async / await to handle common patterns of concurrent and event-driven applications.
  • Sturdy: Dart's null-safe system detects errors during development. Y the overall platform is highly scalable and reliable, with production use for more than a decade by a wide range of applications, including business-critical applications such as Google Ads and Google Assistant.

What's new in Dart 2.12?

This release stands out for the stabilization of the "Null" security mode (Null Safety), which will avoid crashes caused by attempts to use variables whose value is not defined and set to "Null" as it will allow developers to more easily detect null errors during development. Previously, it was difficult to distinguish between code that anticipated passing as null and code that did not work with nulls.

That is to say, implies that variables cannot have null values ​​unless they are assigned explicitly a null value. The mode strictly considers variable types, allowing the compiler to apply additional optimizations. Type conformance is checked at compile time, for example, attempting to assign a "Null" value to a variable with a type that does not imply an undefined state, such as "int", will generate an error. Null Safety is a major change in the language and requires some changes when coding.

Another major improvement in Dart 2.12 is the stable implementation of the FFI library , who allows you to create high-performance code from which you can access the C APIs, since FFI allows passing structures by values ​​and not just by references.

Of the other changes that stand out:

  • Nested structures, common in C, are now supported by Dart FFI.
  • Performance and size optimizations were made.
  • Developer tools and a code profiling system written with Flutter were added, as well as new plugins for developing applications in Dart and Flutter for Android Studio / IntelliJ and VS Code.

Of the future plans for Dart in general it is mentioned that in the next version they will mainly focus on incremental language changes, such as type aliases, triple shift operator, generic metadata annotations and static metaprogramming.

Finally if you are interested in knowing more about it About this new version of the programming language, you can check the details In the following link.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.