Linus Torvalds conducted a review of patches implementing the ability to create drivers in Rust for the Linux kernel and expressed some critical remarks.
The main concerns arose from the potential for panic() to occur in error situations, such as when there is a lack of memory, where dynamic memory allocation operations, including within the kernel, may fail. Torvalds stated that such an approach in the kernel is fundamentally unacceptable, and without understanding this issue, he could completely reject (totally NAKed) any code attempting to use such an approach. On the other hand, the developer working on the patches acknowledged this issue and considers it solvable.
Another problem was attempts to use floating-point calculations or 128-bit types, which are not permissible for environments such as the Linux kernel. This turned out to be a more serious issue, as currently the core Rust library is monolithic and represents one large blob â there is no way to request just some features while preventing the use of problematic functionality. Solving this issue may require changes to the Rust compiler and library, and at present, the team lacks a strategy for how to implement modularity in the libraries of the language.
Furthermore, Torvalds noted that the provided driver example is useless and advised to attach a driver that addresses a real task as an example.
Additionally: Google announced its involvement in the initiative to promote Rust support in the Linux kernel and outlined the technical aspects of the feasibility of integrating Rust to combat issues arising from memory management errors. Google believes that Rust is ready to join C as a language for developing Linux kernel components. The article also provides examples of using Rust for developing kernel drivers in the context of their use on the Android platform (Rust is officially recognized as a supported language for Android development).
Raporti tregon se Google ka përgatitur një prototip fillestar të një drejtpërdrejtësi të shkruar në gjuhën Rust për mekanizmin e ndërveprimit ndër-procesor (Binder), i cili do të lejojë një krahasim të detajuar të performancës dhe sigurisë së implementimeve të Binder në C dhe Rust. Në formën aktuale, puna ende nuk është përfunduar, por tashmë janë përgatitur ndërmjetësit për pothuajse të gjitha abstraksionet bazë të funksionalitetit të bërthamës, të nevojshme për funksionimin e Binder, për t'u përdorur në kodin në gjuhën Rust.
Burimi: opennet.ru
