Rust 1.93 has been released. Projects Rex, Fjall 3, and Arti 1.9.0

The release of the programming language Rust 1.93 has been announced. Originally developed by Mozilla, it is now maintained under the auspices of the independent non-profit organization Rust Foundation. The language focuses on safe memory handling and provides tools for achieving high task parallelism while avoiding garbage collection and runtime; the runtime consists only of basic initialization and support for the standard library.

The memory management methods in Rust relieve developers from errors when manipulating pointers and protect against issues arising from low-level memory operations, such as accessing memory after it has been freed, dereferencing null pointers, buffer overflows, and so on. For distributing libraries, ensuring builds, and managing project dependencies, the package manager Cargo is being developed. A repository at crates.io supports library hosting.

Safe memory handling in Rust is ensured at compile time through reference checking, ownership tracking of objects, lifetime consideration (scope) of objects, and assessment of memory access correctness during code execution. Rust also provides means to protect against integer overflows, mandates the initialization of variable values before use, improved error handling in the standard library, employs the concept of immutability for references and variables by default, and offers strong static typing to minimize logical errors.

Key innovations:

  • The standard C library Musl, included with Rust, used for static linking to target platforms "*-linux-musl" (aarch64-unknown-linux-musl, x86_64-unknown-linux-musl, powerpc64le-unknown-linux-musl, etc.) on systems without Musl, has been updated to version 1.2.5. The minimum supported version of Musl for dynamic linking has also been raised to release 1.2.5. Previously, Rust used Musl version 1.2.3, which had issues with the implementation of the DNS resolver. In Musl version 1.2.4, the DNS resolver was enhanced to allow sending requests over TCP in the event of failed attempts over UDP, resolving issues with large DNS record queries and ensuring compatibility with recursive DNS servers that do not support partial results in truncated UDP responses. In Musl version 1.2.5, the DNS resolver now handles responses with long CNAME sequences and addresses issues that caused some large responses transmitted over TCP to be dropped.
  • The standard library has been redesigned to address reentrancy issues when using global memory allocators written in Rust, as well as the std::thread_local! macro and the std::thread::current function, which led to infinite recursion. To prevent situations where std::thread_local! and std::thread::current invoked the same allocator they are using when attempting to allocate memory, the system's memory allocation mechanism is now applied directly within them.
  • Within "asm!" blocks containing assembly code, the use of "cfg" attributes has been allowed, enabling control over the engagement of extended CPU instruction sets in the context of individual expressions within the asm block (previously, "cfg" attributes could only be specified for the entire asm block). asm!( // or global_asm! or naked_asm! "nop", #[cfg(target_feature = "sse2")] "nop", // … #[cfg(target_feature = "sse2")] a = const 123, // only used on sse2 );
  • A new batch of APIs has been promoted to stable, including stabilized methods and trait implementations:
    • <[MaybeUninit]>::assume_init_drop
    • <[MaybeUninit]>::assume_init_ref
    • <[MaybeUninit]>::assume_init_mut
    • <[MaybeUninit]>::write_copy_of_slice
    • <[MaybeUninit]>::write_clone_of_slice
    • String::into_raw_parts
    • Vec::into_raw_parts
    • ::unchecked_neg
    • ::unchecked_shl
    • ::unchecked_shr
    • ::unchecked_shl
    • ::unchecked_shr
    • ::as_array
    • ::as_array_mut
    • ::as_array
    • ::as_mut_array
    • VecDeque::pop_front_if
    • VecDeque::pop_back_if
    • Duration::from_nanos_u128
    • char::MAX_LEN_UTF8
    • char::MAX_LEN_UTF16
    • std::fmt::from_fn
    • std::fmt::FromFn
  • The target platform 'riscv64a23-unknown-linux-gnu' has been promoted to the second level of support, which implies a guarantee of builds but no guarantees for passing the test suite.

Additionally, there are several related Rust projects worth noting:

  • For the Linux kernel, the Rex framework is being developed, allowing the creation of kernel extensions in Rust, which can be used to enhance the core functionality instead of eBPF. Rex provides the same security guarantees as eBPF but utilizes the safety features of the Rust language and a lightweight runtime for isolation and security. These programs do not use a verifier and are compiled into native code using the Rust compiler.

    Rex programs can use a subset of the Rust language that provides safety guarantees. Currently, five types of eBPF programs are supported: kprobe, perf_event, tracepoint, xdp, and tc. There is the ability to call auxiliary eBPF functions, interact with eBPF map structures, manage kernel resources, handle exceptions, and use wrappers and abstractions over kernel structures.

  • The Fjall 3 release, an embedded key-value store written in Rust, is now available, working with data in a key-value format. Data storage is done in the form of logs using an LSM tree (Log-Structured-Merge), similar to RocksDB, where changes are recorded by appending data to the end of a file. An API styled after BTreeMap is provided for accessing the database. Features such as namespaces, direct and reverse range lookup, built-in compression, serializable transactions, separate storage for keys and associated very large values, and automatic background database maintenance are supported. The code is open under the Apache 2.0 license.
  • The Tor Project has released Arti 1.9.0, an implementation of the Tor toolkit written in Rust. Once the Arti code reaches a level capable of fully replacing the C version, Tor developers plan to make Arti the main Tor implementation and gradually discontinue support for the C implementation. The new version continues to enhance functionality for relays and servers directory authorities, improves support for dynamically allocated ports (proxy.socks_listen = "auto"), and adds an experimental API for managing keys for onion services.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster