The release of the general purpose programming language Rust 1.65, founded by the Mozilla project, now developed under the auspices of the independent non -profit organization Rust Foundation. The language is focused on safe memory work and provides means to achieve a high parallelism of the tasks, while dispensing with the use of the garbage collector and Runtime (Runtime comes down to basic initialization and accompanying the standard library).
Memitory working methods in RUST save the developer from errors when manipulating with signs and protect against problems arising due to low-level memory, such as an appeal to the memory area after its release, the extension of the zero signs, exit beyond the buffer, etc. .P. To distribute libraries, ensure the assembly and management of dependence, the Cargo package manager develops. To place the libraries, the repository is supported by crates.io .
Safe memory work is ensured in RUST during compilation through references checking, tracking the ownership of objects, taking into account the lifetime of objects (visibility) and assessment of the correctness of access to memory during code execution. RUST also provides means to protect against integer overflow, requires mandatory initialization of variables before use, better processes errors in a standard library, applies the concept of irreplaceability (Immutable) links and default variables, offers strong static typification to minimize logical errors.
The main innovations :
- Support for generalized associated types (GAT, GENERIC ASSOCIATED TYPES), which make it possible to create types of types associated with another type, and allow you to connect types of types with types. Trait Foo {Type Bar; }
- The expression “Let … Else” is implemented, which allows you to check the condition for compliance with the template directly inside the expression “let” and execute an arbitrary code if the template does not match. Let Ok (Count) = U64 :: from_str (Count_str) Else {Panic! (“Canomet Parse Integer: ‘{Count_str}'”); };
- permitted Break expression for premature exit from the named blocks using the name using the name block (label) to determine the completed block.
Let Result = ‘Block: {Do_THING (); Ф Condition_not_met () {Break ‘Block 1; } do_next_thing (); Ф Condition_not_met () {Break ‘Block 2; } do_last_thing (); 3
}; - For Linux added the possibility of separate maintenance of debuging information (Split-debuginfo), previously available only for the MacOS platform. When specifying the option “-csplit-debuginfo = unpacked”, the data of Debuginfo in the DWARF format will be saved in several separate object files with the extension “.dwo”. Upon specifying “-csplit-debuginfo = Packed” one package in format. “DWP “will be created, which includes all the data of Debuginfo for the project. To integrate Debuginfo directly into the .debug_* ELF objects section, you can use the option “-csplit-debuginfo = offf”.
- A new portion of the API was transferred to the category of stable, including the methods and implementation of the types:
- std :: Backtrace :: Backtrace
- Bound :: as_ref
- std :: io :: read_to_string