Published general purpose programming language release Rust 1.79, founded by the Mozilla project, but now developed under the auspices of the independent non-profit organization Rust Foundation. The language focuses on memory safety and provides a means to achieve high task parallelism without using garbage collector And runtime (runtime boils down to basic initialization and maintenance of the standard library).
Rust's memory management techniques free the developer from pointer manipulation errors and protect against problems arising from low-level memory manipulation, such as after-free accesses, null pointer dereferences, buffer overruns, and the like. A package manager is being developed to distribute libraries, ensure assembly and manage dependencies by the project. Cargo. A repository is supported to host libraries crates.io.
Memory safety is enforced in Rust at compile time through reference checking, object ownership tracking, object lifetime (scoping) consideration, and memory access evaluation at runtime. Rust also provides protection against integer overflows, requires that variable values be initialized before use, has better error handling in the standard library, uses the concept of immutable references and variables by default, and offers strong static typing to minimize logical errors.
Basic innovations:
- Added support inline constants, which can be specified directly in the code using “const { … }” blocks, processed in the context of constants and allowing you to do without a separate definition constants. The code specified in the “const { … }” block is calculated at the compilation stage and used as a constant, without execution while the program is running. Unlike defining constants through the expression “const ITEM: … = …”, in “const { … }” blocks you do not have to specify the type, since they support automatic type inference. For example, code with a separate constant definition
const EMPTY: Option‹Vec‹u8›› = None; let foo = (EMPTY; 100);
can be replaced by local use:
let foo = (const { None }; 100); - Stabilized syntax “T: Trait‹Assoc: Bounds…›” to specify constraints at the position of an associative type, allowing you to shorten the definition of expressions with nested type constraints that previously required a nested impl Trait or multiple “where” clauses.
- Provided automatic extension of the lifetime of temporary values that are used in the “match” and “if” constructs.
let a = if true { ..; &temp() // время жизни будет продлено } else { ..; &temp() // время жизни будет продлено }; - Stabilized opportunity importing the main function from other modules and crate packages.
- When building the standard library, the compiler uses the “-Cforce-frame-pointers=yes” flag, which adds data for stack reconstruction during program profiling.
- A new portion of the API has been transferred to the stable category, including the methods and implementations of traits:
{integer}::unchecked_add{integer}::unchecked_mul{integer}::unchecked_sub‹(T)›::split_at_unchecked‹(T)›::split_at_mut_unchecked‹(u8)›::utf8_chunksstr::Utf8Chunksstr::Utf8Chunk‹*const T›::is_aligned‹*mut T›::is_alignedNonNull::is_aligned‹*const (T)›::len‹*mut (T)›::len‹*const (T)›::is_empty‹*mut (T)›::is_emptyNonNull::‹(T)›::is_emptyCStr::count_bytesio::Error::downcastnum::NonZero‹T›path::absoluteproc_macro::Literal::byte_characterproc_macro::Literal::c_string
- The “const” attribute, which determines the possibility of using it in any context instead of constants, is used in functions:
- Stabilized
part of the possibilitieswhich can be used when compiling into a Webassembly intermediate representation (WASM). - The third level of support has been implemented for the aarch64-apple-visionos, aarch64-apple-visionos-sim and riscv32ima-unknown-none-elf platforms. The third level involves basic support, but without automated testing, publishing official builds, or checking whether the code can be built.
- The second level of support for the target platforms aarch64-pc-windows-gnullvm, i686-pc-windows-gnullvm and x86_64-pc-windows-gnullvm has been implemented. The second level of support involves an assembly guarantee.
Additionally, the Rust Foundation, which oversees the Rust language ecosystem, announced on the creation of the “Safety-Critical Rust Consortium”, aimed at using the Rust language in solutions that require increased reliability (Safety-Critical Software), the failure of which could threaten human life, harm the environment or lead to serious damage to equipment. The consortium was joined by ARM, AdaCore, Ferrous Systems, OxidOS, Synopsys, HighTec EDV-Systeme GmbH, TrustInSoft, Veecle and Woven by Toyota. Among the tasks that the consortium will solve are the writing of manuals and the development of libraries, linters and static analyzers, as well as the use of formal reliability verification methods and the development of language subsets for highly reliable systems.
Among the projects related to highly reliable systems, we can note Verus – tools for checking the correctness of code written in the Rust language. Verification is accomplished by defining a specification that describes the acceptable behavior of the code. During execution of executable code, Verus performs static checks against the specification to ensure correct operation.
Thanks for reading: