The Linux kernel has been primarily written in C and assembly languages since its first release in 1991. Around 1997, the addition of
C++ was considered and experimented upon for two weeks before being scrapped. Rust was created in 2006 and combines the performance of
low-level programming languages (such as C) with a focus on
memory safety and a
user-friendly tool set and
syntax. An example Linux external
loadable kernel module created using the Rust language was published by Taesoo Kim in 2013. The Rust for Linux project was announced in 2020 in the
Linux kernel mailing list with goal of adding Rust as a programming language that could be used within the Linux project. At the
Open Source Summit 2022,
Linus Torvalds stated that the incorporation of the project's work could begin as soon as the Linux 5.20 release, later named as Linux 6.0. The first release candidate for Linux 6.0 was created on 14 August 2022, without Rust support. In the release notes for Linux 6.0-rc1, Torvalds expressed his intention for adding Rust support, "I actually was hoping that we'd get some of the first rust infrastructure, and the multi-gen LRU VM, but neither of them happened this time around." On 19 September 2022, an article from
ZDNet revealed an email from Linus Torvalds stating that "Unless something odd happens, it [Rust] will make it into 6.1". In October 2022, a
pull request for accepting the implementation for Rust for Linux was approved by Torvalds. As of Linux 6.1, support was intentionally left minimal in order to allow developers to test the feature. Rust for Linux developers created a new library "pinned-init" to safely and fallibly
initialize memory that must not be relocated. It was first included in Linux 6.4, and been improved in later versions. In July 2024 a change was accepted into Linux to support multiple Rust versions for the first time, allowing compiling using both 1.78 (Released 2 May, 2024) and 1.79 (Released 13 June, 2024). , Rust for Linux depends on unstable features of the Rust compiler. This expands the core languages in the Linux kernel to C, assembly and Rust. == Usage ==