The Rust 1.94 programming language, founded by the Mozilla project but now developed under the auspices of the independent non-profit Rust Foundation, has been released. The language focuses on memory safety and provides tools for achieving high parallelism of task execution, while doing without the use of a garbage collector and runtime (the runtime is reduced to basic initialization and maintenance of the standard library).
Rust's memory management methods are designed to eliminate errors in pointer manipulation and protect against issues arising from low-level memory management, such as accessing memory after it has been freed, dereferencing null pointers, buffer overruns, and so on. The project is developing the Cargo package manager to distribute libraries, facilitate builds, and manage dependencies. The crates.io repository is maintained for hosting libraries.
Memory safety is provided in Rust at compile time through reference checking, keeping track of object ownership, keeping track of object lifetimes (scopes), and assessing the correctness of memory access during code execution. Rust also provides protection against integer overflows, requires mandatory initialization of variable values ββbefore use, handles errors better in the standard library, applies the concept of immutable references and variables by default, offers strong static typing to minimize logical errors.
Main innovations:
- The slice type now has an array_windows method. This method creates an iterator for traversing slices in fixed-size windows that advance one element at a time. Unlike the previously available windows method, array_windows operates on a constant window size and returns a reference to a fixed-size array (&[T; N]) instead of a slice of undefined size (&[T]) for each iteration. Since the array size is initially known to the compiler, performance can be improved by avoiding bounds checking at each iteration stage. let slice = [0, 1, 2, 3]; let mut iter = slice.array_windows(); assert_eq!(iter.next().unwrap(), &[0, 1]); assert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());
- The Cargo package manager's configuration files (.cargo/config.toml) implement the "include" directive, which allows you to in-place insert the contents of other files. include = [ "frodo.toml", "samwise.toml", ] include = [ { path = "required.toml" }, { path = "optional.toml", optional = true }, ]
- Support for the new version of the TOML 1.1 markup language has been added to manifest and configuration files. This new version adds support for multi-line embedded tables, the "\xHH" escape sequence for inserting hexadecimal byte representations, and the "\e" escape sequence for "\u001B," along with the ability to leave a trailing comma at the end of the last element and omit seconds in time values. serde = { version = "1.0", features = ["derive"] } can now be replaced with serde = { version = "1.0", features = ["derive"], }
- A new portion of the API has been moved to the category of stable, including the methods and implementations of traits have been stabilized:
- <[T]>::array_windows
- <[T]>::element_offset
- LazyCell::get
- LazyCell::get_mut
- LazyCell::force_mut
- LazyLock::get
- LazyLock::get_mut
- LazyLock::force_mut
- impl TryFrom for use
- std::iter::Peekable::next_if_map
- std::iter::Peekable::next_if_map_mut
- Intrinsics for x86 avx512fp16 instructions
- Intrinsics for AArch64 NEON fp16 instructions
- f32::consts::EULER_GAMMA
- f64::consts::EULER_GAMMA
- f32::consts::GOLDEN_RATIO
- f64::consts::GOLDEN_RATIO
- The "const" sign is used in functions:
- f32::mul_add
- f64::mul_add
- The riscv64im-unknown-none-elf platform has been moved to support level 3. Support level 3 includes basic support, but does not include automated testing, official build releases, or build verification.
Additionally, we'd like to highlight recently announced projects and events related to Rust:
- Ayrton MuΓ±oz, who implemented support for the Sony PlayStation 1 platform in the Rust compiler and ported FreeBSD to computers with Apple Silicon chips, has implemented the ability to write kernel components and device drivers in Rust for FreeBSD. A set of KPI (Kernel Programming Interface) bindings enabling the use of Rust code in the FreeBSD kernel has been provided for testing, along with the virtio sound driver (virtio_snd), the DockChannel HID driver for the M2 MacBook keyboard, and several low-level drivers for Mac computer subsystems on Apple Silicon chips, all created using these bindings.
Work on the Rust bindings has been ongoing since late 2024. Currently, the bindings only implement a portion of the C-KPIs and are considered unstable, but over time, they plan to improve their stability to match that of a similar interface for the C language. The virtio_snd driver, proposed as an example, is suitable for playing music in QEMU. It is expected that by 2026, the Rust bindings will be sufficiently stable for interested developers to begin using them for writing code.
- NetBSD developer Benny Siegert offered a rationale for why Rust support will not appear in the NetBSD kernel: NetBSD supports architectures for which Rust is not available; maintaining the existing Rust toolchain in pkgsrc is a significant effort and is supported by only a few developers; kernel support for Rust requires the Rust compiler to be included in the base system; bootstrapping Rust on NetBSD uses a legacy binary package, which is unacceptable for self-contained distributions distributed as source; Rust's release cycles are incompatible with NetBSD's development and support cycles for legacy branches (for example, NetBSD 9, released in 2020, continues to be supported, which would require shipping and supporting a six-year-old Rust compiler).
- ΠΠΏΡΠ±Π»ΠΈΠΊΠΎΠ²Π°Π½ Π²ΡΠΏΡΡΠΊ Π²ΡΡΡΠ°ΠΈΠ²Π°Π΅ΠΌΠΎΠΉ Π² ΠΏΡΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΡ Π‘Π£ΠΠ Turso 0.5, Π½Π°ΠΏΠΈΡΠ°Π½Π½ΠΎΠΉ Π½Π° ΡΠ·ΡΠΊΠ΅ Rust ΠΈ ΡΠΎΠ²ΠΌΠ΅ΡΡΠΈΠΌΠΎΠΉ Ρ SQLite Π½Π° ΡΡΠΎΠ²Π½Π΅ Π΄ΠΈΠ°Π»Π΅ΠΊΡΠ° SQL, ΡΠΎΡΠΌΠ°ΡΠ° ΡΠ°ΠΉΠ»ΠΎΠ² ΠΠ ΠΈ C API. ΠΠ· ΡΠ°ΡΡΠΈΡΠ΅Π½Π½ΡΡ Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΠ΅ΠΉ ΠΎΡΠΌΠ΅ΡΠ°Π΅ΡΡΡ ΠΌΠ΅Ρ Π°Π½ΠΈΠ·ΠΌ CDC (Change data capture) Π΄Π»Ρ ΠΎΡΡΠ»Π΅ΠΆΠΈΠ²Π°Π½ΠΈΡ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ ΠΠ Π² ΡΠ΅Π°Π»ΡΠ½ΠΎΠΌ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ io_uring Π΄Π»Ρ Π°ΡΠΈΠ½Ρ ΡΠΎΠ½Π½ΠΎΠ³ΠΎ Π²Π²ΠΎΠ΄Π°/Π²ΡΠ²ΠΎΠ΄Π° Π² Linux, ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠ° Π²Π΅ΠΊΡΠΎΡΠ½ΠΎΠ³ΠΎ ΠΏΠΎΠΈΡΠΊΠ°, Π½Π°Π»ΠΈΡΠΈΠ΅ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΡ ALTER Π΄Π»Ρ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ ΡΡ Π΅ΠΌΡ ΠΠ, Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡΡ ΡΠΈΡΡΠΎΠ²Π°Π½ΠΈΡ Π΄Π°Π½Π½ΡΡ Π² ΠΠ, ΡΠ΅ΠΆΠΈΠΌ ΠΈΠ½ΠΊΡΠ΅ΠΌΠ΅Π½ΡΠ°Π»ΡΠ½ΡΡ Π²ΡΡΠΈΡΠ»Π΅Π½ΠΈΠΉ, ΠΊΠΎΠ½ΡΡΡΡΠΊΡΠΈΡ Β«BEGIN CONCURRENTΒ».
- A project to enable the use of the Rust standard library in GPU-side programs.
- Emuko β ΡΠΌΡΠ»ΡΡΠΎΡ RISC-V, Π½Π°ΠΏΠΈΡΠ°Π½Π½ΡΠΉ Π½Π° Rust, ΡΠΏΠΎΡΠΎΠ±Π½ΡΠΉ Π·Π°Π³ΡΡΠΆΠ°ΡΡ Linux, ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΈΠ²Π°ΡΡΠΈΠΉ JIT-ΠΊΠΎΠΌΠΏΠΈΠ»ΡΡΠΈΡ, ΡΠΏΠΎΡΠΎΠ±Π½ΡΠΉ ΡΠΎΡ ΡΠ°Π½ΡΡΡ ΠΈ Π²ΠΎΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°ΡΡ ΡΠ½Π°ΠΏΡΠΎΡΡ ΡΠΎΡΡΠΎΡΠ½ΠΈΡ.
- RustConn (flatpak) is a graphical interface for managing external network connections to other hosts, supporting SSH, RDP, VNC, SPICE, Telnet, Serial, Kubernetes, Zero Trust, and SFTP. The code is written in Rust using GTK4 and Wayland.
- A new branch of the zlib-rs 0.6 project has been released, marking it as the first stable version fully compatible with the zlib C API and suitable for a transparent replacement for zlib. The project aims to create a secure alternative to the zlib data compression library. Development is being conducted with an eye on the zlib-ng project, which develops a high-performance variant of zlib.
- The VCAD project is a development of a parametric computer-aided design (CAD) system written in Rust and integrated with AI agents using the MCP protocol. It supports 3D modeling, simulation, 2D sketching, component assembly, STEP import, and STL/GLB/STEP/DXF export.
- A speech recognition system written in Rust and using the Mistral Voxtral Mini 4B Realtime AI model and the Burn machine learning framework has been published. The project focuses on on-the-fly speech recognition for live streaming transcription.
- The c2rust 0.22 toolkit has been released. It is designed for translating C code (C99) into an unsafe Rust representation, similar in structure to the original C code. The resulting working framework can be used for gradual migration to idiomatic Rust and the removal of unsafe blocks.
Source: opennet.ru
