Several Linux developers are concerned about adding Rust code to the open-source operating system, particularly in the kernel. This has led to heated discussions within the community. Linus Torvalds remains a proponent of the integration.
Within the Linux kernel mailing list, there has been a big discussion about adding Rust code to improve the kernel. Some developers and maintainers feel that adding this code, or any new code at all, into an existing codebase only creates problems and is difficult to maintain.
Proponents of Rust in the Linux kernel acknowledge that maintaining multi-language codebases can be challenging, but argue that they now have enough experience to manage it properly.
Discussion around DMA API Linux kernel
The discussion began with a proposed patch that would allow device drivers written in Rust to address the Linux kernel’s primarily C-based DMA API. Kernel maintainer Christoph Hellwig vehemently opposed this, comparing maintaining multiple programming languages in Linux to cancer.
This led to criticism from other maintainers who did support Rust integration. Eventually a “Rust kernel policy” was drafted, but that did not cause Hellwig to withdraw his objections.
Rust part of Linux kernel since 2022
Rust has been part of the Linux kernel since 2022 because it offers better memory safety than C. It has long been known that many memory errors can be avoided by using safe programming languages and tools. Consider languages such as Rust, Go, C#, Java, Swift, Python, and JavaScript.
The thinking goes that using these languages, especially Rust, in Linux can largely solve errors arising from the use of older languages such as C and C++.
Older programmers who work primarily with C and C++ are not always happy about this. They fear that their work, including kernel maintenance, will become irrelevant. Many Linux experts understand this concern but, at the same time, emphasize that the implementation of Rust can actually help solve many bugs. According to them, integrating Rust strengthens the existing C and C++ codebase.
Torvalds in favor of Rust integration
Meanwhile, Linux guru Linus Torvalds has also entered the discussion. In principle, he remains a proponent of Rust integration. According to him, Linux maintainers must realize that this development will continue and that they cannot decide for themselves whether, for example, certain device drivers will be written in Rust.
Also read: Linux Kernel 6.13 released: this is new