Rust programming language 1.54 release

The release of the system programming language Rust 1.54, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation, has been published. The language focuses on safe memory management, provides automatic memory management, and provides the means to achieve high job parallelism while avoiding the use of a garbage collector and runtime (runtime is reduced to basic initialization and maintenance of the standard library).

Rust's automatic memory management saves the developer from errors when manipulating pointers and protects against problems that arise due to low-level memory manipulation, such as accessing a memory area after it has been freed, dereferencing null pointers, buffer overruns, etc. To distribute libraries, provide builds and manage dependencies, the project develops the Cargo package manager. The crates.io repository is supported for hosting libraries.

Main innovations:

  • Added the ability to use macros inside attributes that resemble functions (procedural macros and macros created using the "macro_rules!" macro). Similar macros differ from functions by the symbol "!" after the name (macro!(…)) and substituting the macro's source text instead of generating a function call. Calling macros within attributes can be useful for including content from other files in doc comments. For example, to insert the contents of a README file and the result of a script, you can specify: #![doc = include_str!("README.md")] #[path = concat!(env!("OUT_DIR"), "/generated.rs" )] mod generated;
  • The built-in compiler functions (Intrinsics) for the wasm32 platform have been stabilized, allowing the use of SIMD instructions in WebAssembly. Most of the functions, such as v128_bitselect, are available in "safe" mode, but some functions that work with pointers (for example, v128_load) remain "unsafe".
  • The use of incremental compilation by default has been returned, which allows rebuilding only the changed parts of the code, which can significantly reduce the build time of the project when recompiling after making minor changes. Incremental compilation was disabled in the 1.52.1 release due to hidden bugs that surfaced after adding an additional check for loading data from the disk cache.
  • A new portion of the API has been transferred to the category of stable, including stabilized:
      BTreeMap::into_keys
    • BTreeMap::into_values
    • HashMap::into_keys
    • HashMap::into_values
    • arch::wasm32
    • VecDeque::binary_search
    • VecDeque::binary_search_by
    • VecDeque::binary_search_by_key
    • VecDeque::partition_point
  • Added options to cargo-tree: "--prune ' to remove the package from the dependency graph, '--depth' to display only elements of a given nesting level in the dependency tree, '--edges no-proc-macro' to hide the dependencies of procedural macros.

Source: opennet.ru

Add a comment