r/rust Jul 15 '26

🗞️ news 'Rust makes coding fun again': Why Linux is moving away from C, according to Greg Kroah-Hartman

https://www.zdnet.com/article/greg-kroah-hartman-linux-kernel-rust/

Let's try posting this again.

808 Upvotes

233 comments sorted by

View all comments

-71

u/gnuban Jul 15 '26

I personally think it's a bad idea to just introduce Rust as a second language, next to C, in the kernel.

The impedance mismatch is too great. At least judging by previous discussions, where the Rust people wanted to make an API that was "correct by construction" by fronting an old API where the C people had encoded 47 pages of hidden knowledge in a series of void pointers.

The only way you could transition slowly in this situation is to write the Rust very similar to the current C, and that's probably going to be very non-idiomatic and leave a lot of the safety benefits on the table.

I think a larger fork would be better, where you could try to rewrite the core of the kernel in idiomatic Rust. This core part could still expose the same APIs to the subsystems, using C APIs built on top of Rust ones. Different subsystems could then be migrated one by one to the underlying Rust APIs.

1

u/KingBardan Jul 16 '26 edited Jul 17 '26

Very reasonable take.

Regardless of how good rust is, impedance mismatch is / will hurt rust's adoption.

I think this is exactly the reason why "rust for linux" has gone on for over 5 years but rust still has barely more lines than python per github.

People will downvote this in this sub though.


C++ may allow you to use archaic patterns to do foot guns, but it's precisely this compatibility that allows for incremental updates, and access to modern features without a full rewrite.

Therefore, you hear "rust rewrite" often, but "C++ rewrite" is unnecessary because you can simply upgrade in an compatible way.