Release of the Dart 2.8 programming language

Took place programming language release Dart 2.8, which continues the development of a radically redesigned Dart 2 branch, refocused on development for the Web and mobile systems and optimized for creating client-side components.

Dart 2 differs from the original Dart language in that it uses strong static typing (types can be automatically inferred so types are optional, but dynamic typing is no longer used and the natively computed type is assigned to a variable and strict type checking is then applied). For developing web applications offered a set of specific libraries such as dart:html, as well as the Angular web framework. A framework is being promoted for creating mobile applications Flutter;, on the basis of which, among other things, the user shell of the new microkernel operating system being developed at Google is built Fuchsia.

In the new release:

  • Added means to safely use the "Null" value, breaking backwards compatibility. For example, at compile time, an error will now be thrown if you try to assign the value "Null" to a variable with a type that does not imply an indeterminate state, such as "int". There are also restrictions on the compatibility of variables with types that allow Null and not, such as "int?" and "int" (a variable of type "int?" can be assigned to a variable of type "int", but not vice versa). The same applies to variables returned in the "return" operator - if a variable with a type that does not allow the "Null" state is not assigned a value in the body of the function, the compiler will display an error. These changes will avoid crashes caused by attempts to use variables whose value is not defined and set to "Null".
  • Repository pub.dev passed the mark of 10 thousand packages. As part of the Dart 2.8 build cycle, the performance of fetching packages from pub.dev has been greatly improved by supporting fetching packages in multiple parallel streams when running the "pub get" command, and by delaying precompilation when running the "pub run" command. Testing the "pub get" command for a new project based on Flutter showed a decrease in the operation time from 6.5 to 2.5 seconds, and for larger applications, such as the Flutter gallery, from 15 to 3 seconds.
  • A new "pub outdated" command has been added to keep all installed package dependencies up to date. Using the "pub outdated" command, without modifying the pubspec file, you can evaluate the presence of newer major versions for all dependencies associated with a specified package. Unlike "pub upgrade", the new command checks not only for versions that match the pubspec, but also for newer branches. For example, for a package with sticky dependencies "foo: ^1.3.0" and "bar: ^2.0.0", running "pub outdated" will show both updatable and newer branches:

    Dependencies Current Upgradable Resolvable Latest
    foo 1.3.0 1.3.1 1.3.1 1.3.1
    bar 2.0.1 2.1.0 3.0.3 3.0.3

Dart language features:

  • A familiar and easy-to-learn syntax that is natural for JavaScript, C, and Java programmers.
  • Providing fast startup and high performance for all modern web browsers and various types of environments, from portable devices to powerful servers;
  • Ability to define classes and interfaces that allow encapsulation and reuse of existing methods and data;
  • Specifying types makes it easier to debug and detect errors, makes the code clearer and more readable, and makes it easier for third-party developers to refine and analyze it.
  • Among the supported types: various types of hashes, arrays and lists, queues, numeric and string types, date and time types, regular expressions (RegExp). Maybe creation of their types;
  • To organize parallel execution, it is proposed to use classes with the isolate attribute, the code of which is executed completely in an isolated space in a separate memory area, interacting with the main process by sending messages;
  • Support for the use of libraries that simplify the support and debugging of large web projects. Third-party implementations of functions can be included as shared libraries. Applications can be broken down into parts and the development of each part can be assigned to a separate team of programmers;
  • A set of ready-made tools to support development in the Dart language, including the implementation of dynamic development tools and debugging with code correction on the fly ("edit-and-continue");
  • To simplify development in the Dart language, a SDK, package manager Ads, static code analyzer dart_analyzer, set of libraries, integrated development environment Dartpad and Dart-enabled plugins for IntelliJ IDEA, WebStorm, Emacs, Sublime Text 2 ΠΈ Vim;
  • Additional packages with libraries and utilities are distributed through the repository Ads, which has more than 10 thousand packages.

Source: opennet.ru

Add a comment