A slow change is coming to the Linux kernel, and it’s as fundamental as it gets for programmers: the very language they write in. Such an impactful move has to be handled carefully, but it’s cause for celebration.
What’s the Linux Kernel Written In at the Moment?
The Linux kernel is the core of the operating system, with low-level control of resources like memory, processor, and file systems. It’s the kind of software that is hidden from 99.99% of users, but it affects everything that happens on your computer.

Related
What Is the Linux Kernel, and Why Does It Matter?
What’s at the center of it all?
Linus Torvalds began developing the kernel in 1991, using C (a low-level language) and assembly (about as low-level as it gets). Despite attempts to introduce support for higher-level languages, like C++ in 1997, the kernel has stuck with C ever since. Even today, its GitHub repository reports that a massive 98% of the kernel code is written in C:
Apart from the failed C++ experiment, the only other language with a potential stake in the kernel has been Rust. A fairly new language, Rust 1.0 arrived in 2015 with a similar syntax to C, but design influences from languages across the board. Programmers had already been experimenting with earlier versions of the language as an option for kernel module programming, with a proof of concept developed in 2013.
Since then, Linux developers have taken steps to use Rust in kernel development, although progress has been slower than expected. The Rust for Linux project began in 2020 and marked the start of a determined effort to port kernel drivers to Rust, in an attempt to reduce bugs. This led to the eventual inclusion of Rust-written drivers in version 6.8 of the kernel, which was released in December 2023.

Related
What Is a Programming Language?
Ever wondered what programming languages are?
What’s Changing Now?
More and more Rust drivers are being added to the Linux kernel. While Rust code represents just 0.1% of the total codebase, that’s still 143 separate files across all facets of the kernel.
The 6.16 version of the kernel has Rust for Linux improvements to fix race conditions. Kernel updates tend to release every two months, so ongoing Rust work is current, and the project is still very active. It seems as if the kernel developers are still keen on pursuing the move, even if there have been occasional voices of dissent.
The Tyr driver for ARM Mali GPUs is a contemporary example of Rust for Linux work. This kernel graphics driver is written in Rust and aims to expand upon the more theoretical work that has been carried out so far. Having a real driver that depends on existing compatibility means there’s a real-world test for the work carried out so far. This should help to encourage faster progress with the Rust for Linux initiative.
Why Is This a Good Thing?
The Rust website currently describes it as:
A language empowering everyone to build reliable and efficient software.
This statement doesn’t explicitly target kernel programming, but the code at the core of an OS, especially, needs to be reliable and efficient.
One of Rust’s key selling points is its memory safety. The way that a language deals with memory allocation is one factor that determines if it’s a low-level language or a high-level one. Low-level languages give programmers a lot of power, letting them manage memory manually, but expecting them to do so responsibly. Higher-level languages tend to protect the programmer, handling memory allocation on their behalf. A garbage collector is often employed to clean up memory automatically, but this can lead to inefficiencies.
Rust has a different approach: it uses an ownership system to enforce memory-safe techniques without requiring a processing-intensive garbage collector. The language also handles concurrency in a similar way, addressing another feature that is often a source of bugs.

Related
What Is a Memory Leak, and What Can You Do About It?
A memory leak can cause your computer to run slow. Learn how to spot one and how to get your RAM back.
Bugs in the kernel are particularly insidious because they can affect any other program code that happens to be running. They can also be difficult to spot and, since the code they inhabit is highly optimized, difficult to diagnose and fix. Kernel bugs can also be much more catastrophic than bugs in apps: they can take entire systems down and open security holes for bad actors to exploit.
Avoiding these bugs means that kernel developers need to take their time and pay extra attention to their work. In short, kernel bugs lead to slower progress. This is one reason I’m excited about the move to Rust. By eliminating certain types of bugs, it has the potential to speed up kernel development and increase the rate of progress.
Rust is also gaining in popularity. Although C is still more popular (20.3% vs. 12.6% according to 2024’s StackOverflow survey), Rust is catching up, and it’s entirely possible that more new programmers, now or soon, will be using Rust. Even if the kernel is slow to adopt modules written in Rust right now, the work to prepare it is valuable.
And that brings me to my final point: even just considering an alternative language is beneficial. Having eyes on all parts of the codebase, inspecting the architecture, making it more adaptable to other languages, must be a good thing.

Related
Why You Should Learn Rust, Especially If You’re New to Programming
Rust is one of the newest programming languages, and it can change how you see code.
Leave a Comment
Your email address will not be published. Required fields are marked *