The state of the kernel Rust experiment

lwn.net

79 points by dochtman 6 days ago


Rakshath_1 - an hour ago

After five years real shipping Android devices, growing subsystem adoption and active compiler support it’s hard to call this anything but a success. Rust in the kernel isn’t about replacing C overnight it’s about making new code safer and attracting new contributors and by those measures it’s clearly working.

Jean-Papoulos - 21 minutes ago

>Bergmann agreed with declaring the experiment over, worrying only that Rust still "doesn't work on architectures that nobody uses".

I love you Arnd. More seriously, this will become an issue when someone starts the process of integrating Rust code into a core subsystem. I wonder whether this will lead to the kernel dropping support for some architectures, or to Rust doing the necessary work. Probably a bit of both.

aw1621107 - 3 hours ago

Once again, congrats to the R4L team! It's a big milestone and I'm looking forwards to future developments!.

There was a lot of interesting discussion on the previous post [0], but one thing I didn't see was much discussion about this bit:

> The DRM (graphics) subsystem has been an early adopter of the Rust language. It was still perhaps surprising, though, when Airlie (the DRM maintainer) said that the subsystem is only "about a year away" from disallowing new drivers written in C and requiring the use of Rust.

I was a bit surprised when I first read this. Is this meant to be read in a way that is more just a description of the state of Rust bindings (e.g., the DRM subsystem is about a year away from being able to require the use of Rust, but isn't actually planning on doing so), or it is describing actual plans (e.g., the DRM subsystem is about a year away from actually requiring the use of Rust)? I was originally more inclined to go for the former interpretation, but this other bit:

> With regard to adding core-kernel dependencies on Rust code, Airlie said that it shouldn't happen for another year or two.

Makes me think that perhaps the devs are actually considering the latter. Is anyone more in-the-know able to comment on this?

[0]: https://news.ycombinator.com/item?id=46213585

globalnode - 9 minutes ago

How do you know something was written in Rust? -- they'll tell you.

jgarzik - 2 hours ago

Somewhat related, a kernel in Rust: https://github.com/jgarzik/hk

yourdetect - 3 hours ago

From the comment section:

> To me the more salient questions are how long before (a) we get Rust in a core subsystem (thus making Rust truly _required_ instead of "optional unless you have hardware foo"), and (b) requiring Rust for _all_ new code.

Previously, the position was that C developers would not be forced to learn Rust.

And a few days ago a security vulnerability was found in the Rust Linux kernel code.

https://news.ycombinator.com/item?id=46309536

keepamovin - 2 hours ago

Offtopic but this title makes me want to create an alternate-universe version of the HN front page where every title is shrill/spectacular/hysterical/urgent/clickbaity. Such as:

The Absolute State of the Kernel Rust Experiment Right Now

And every comment has its confidence/aggressiveness taken up to 11 (tho still within site rules).

RustSupremacist - an hour ago

This author is not someone who should be reporting on Rust especially in the kernel: https://www.youtube.com/watch?v=gVC1gp2PS8U&t=1538s