Dart 2.15 arrives with isolated groups, runtime improvements and more

Google recently unveiled the launch of the new version of the programming language Dart 2.15, which continues development of a radically redesigned branch of Dart 2 and that differs from the original version of the Dart language by the use of strong static typing (types can be inferred automatically, so specifying types is not required, but dynamic typing is no longer used and is initially calculated, the type is assigned to the variable and then a strict type check is applied).

In this new version, various improvements have been implemented and above all the introduction of some new features such as isolated groups and also solutions to some detected vulnerabilities.

Main new features of Dart 2.15

In this new version of Dart 2.15 tools are provided for fast parallel execution of tasks with controller isolation.

Besides that in multi-core systems, the runtime Dart, by default, runs application code on a CPU core and uses other cores to perform system tasks such as asynchronous I / O, writing to files, or making network calls.

Another novelty that Dart 2.15 introduces is a new concept, isolated groups, (isolate groups) allowing shared access to different internal data structures in isolates belonging to the same group, which can significantly reduce the overhead when communicating with agents in a group. For example, starting an additional isolation on an existing pool is 100 times faster and requires 10 to 100 times less memory than initiating a separate isolation, eliminating the need to initialize the data structures of the program.

Despite the fact that in isolated blocks in a group, shared access to mutable objects is still forbidden, groups use shared dynamic memory, significantly speeding up the transfer of objects from one block to another without the need for resource-intensive copy operations.

In the new version, it is also allowed to pass the result of controller work when Isolate.exit () is called to pass data to the main isolation block without performing copy operations. In addition, optimization of the message transmission mechanism has been carried out: small and medium messages are now processed approximately 8 times faster. The objects that can be passed between isolates using the SendPort.send () call include various types of functions, closures, and stack traces.

In the tools for creating pointers to individual functions in other objects, restrictions on creating such pointers have been removed in the constructor code, which can be useful when creating interfaces based on the library Flutter.

Library dart: core has improved enum support, for example, you can now generate a string value from each enumeration value using the ".name" method, get values ​​by name, or match value pairs.

It is also highlighted that a pointer compression technique has been implemented, what allows to use a more compact representation of pointers in 64-bit environments if the 32-bit address space is sufficient for addressing (no more than 4 GB of memory is used). Tests have shown that such optimization reduces the heap size by approximately 10%. In the Flutter SDK, the new mode is already enabled for Android by default and it is planned to be enabled for iOS in a future release.

Also it is noted that the pub.dev repository now has the ability to revoke an already published version of a package, for example, in case of dangerous bugs or vulnerabilities.

Of the other changes that stand out:

  • Additional protection against vulnerability (CVE-2021-22567) caused by the use of Unicode characters that change the display order in the code.
  • Fixed a vulnerability (CVE-2021-22568) that could impersonate another pub.dev user when publishing packages to a third-party server that accepts oauth2 access tokens from pub.dev.
  • The Dart SDK includes tools for debugging and performance analysis (DevTools), which were previously delivered in a separate package.
  • Tools were added to the "dart pub" command and the pub.dev package repositories to track accidental release of sensitive information, for example leaving credentials for continuous integration systems and cloud environments within the package.
  • If such leaks are found, the "dart pub publish" command will stop with an error message. In the event of a false alarm, it is possible to skip the check via the white list.

Source: https://medium.com/


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

Your email address will not be published.

*

*

  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.