Why Linux Is Embracing Rust: What It Means for Kernel Development
Linux will start supporting the Rust programming language from kernel version 6.1, adding about 12,500 lines of code, with ongoing work from the Rust‑for‑Linux community, GCC’s Rust front‑end integration, and early driver examples demonstrating Rust’s potential in kernel development.
Read: Linux will support the Rust programming language in its kernel starting from version 6.1.
In a recent Linux kernel mailing‑list post, Linus Torvalds promised “some fairly core new things” for the kernel, and the first appears to be direct support for Rust.
The Rust patches for Linux have been in development for a while, with version 9 released in August 2022.
At a recent open‑source summit, Torvalds’ keynote indicated that Linux users should expect Rust to appear in kernel 6.1.
Currently, a group of developers (the Rust‑for‑Linux project) are working to integrate Rust into the kernel.
When kernel developer Kees Cook submitted a request on October 1, Torvalds accepted it, marking the first unstoppable step toward inclusion in 6.1.
Adding Rust support introduces roughly 12,500 new lines of code to the Linux kernel, which is written in C, and Rust offers some interoperability with C.
However, GCC cannot compile the new language yet. With official Linux support and an eager kernel‑hacker community, Rust becoming available for more architectures is only a matter of time.
GCC’s Rust front‑end project gccrs has been approved for merging into the GCC mainline, meaning the next GCC release will be able to compile Rust source code.
According to reports, the GCC Rust patches are rewritten based on the upstream GCC codebase, establishing a skeleton for the new front‑end and providing initial target hooks for i386 and ARM before laying out the front‑end code. Moreover, GCC supports many more targets than the standard Rust compiler.
Integrating GCC as a backend into rustc can better support these targets. Besides LLVM, the rustc master also provides developing backends for Cranelift (faster debug compilation) and GCC (access to architectures not supported by LLVM).
Linux developers have begun demonstrating what Rust can achieve on Linux; Western Digital chief engineer Andreas Hindborg showcased a Rust‑written NVMe SSD driver at the 2022 Linux Plumbers summit.
C has long been the sole language for the Linux kernel, but massive effort has been made to bring Rust into the kernel. Miguel Ojeda led a movement to add Rust natively. With the imminent release of version 6.1, Rust developers can finally start programming on Linux.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
