The release of the System Programming Language Rust 1.51, based on the Mozilla project, but is now developing under the patronage of the independent non-profit organization RUST FOUNDATION. The language is focused on safe memory operation, provides automatic memory management and provides tools for achieving high parallelism to perform tasks, while paying down without using garbage collection and runTime (Runtime is reduced to the basic initialization and support of the standard library).
Automatic memory control in Rust eliminates the developer from errors when manipulating pointers and protects against problems resulting from low-level work with memory, such as referring to the memory area after its release, making zero pointers, output beyond the borders of the buffer, etc. P. To disseminate libraries, ensuring the assembly and management of the project, the CARGO batch manager is developing. To accommodate libraries, the repository crates.io .
Basic innovations :
- The functionality associated with the use of constant generics (“Const Generics”) received the status of the minimum viable product (MVP), which gives green light to wide application. Constant generics allow you to generalize the types for constant values, i.e. Use generalized arguments limited by a range of permanent values, and not types and not life time. This feature makes it possible to use types that are parametrized by integers and abstract when creating types for arrays of any size without the need to create a separate type for each range of valid values to ensure the absence of an allowable range.
Starting from the current release, for arrays With the type “[T; N]” (T Type T and size N) is given the ability to abstract from type and size, using values with any integer, boolean and symbolic types (Types of Struct and Enum are not yet supported). Constant generics greatly simplify the development of libraries, for example, to use an array that is not attached to a specific type and size can be specified:
struct array {// ^^^^^^^^^^^^^^^^^^^^^ ^^ Definition of constant generic List: [T; LENGTH] // ^^^^^^^ Its Use}
In the actual use with this definition “Array”
The compiler will generate the monomorphic version of Array: Struct Array {List: [U8; 32]}