Originally posted by bug77
View Post
- Driver code is kernel code, you can't claim "Rust will not be in the kernel at all" just because "it's only drivers". The 6.1 kernel is only getting support code with no driver or anything user-facing, but it's still a few thousand lines of Rust
- Rust code does of course call into existing C apis. But the wrappers are a bit more sophisticated than a straight unsafe binding: they often offer a more idiomatic Rust API and are safe to call. The goal is that most drivers can be written without any unsafe.
- While Rust can't be used for core parts of the kernel (yet), it's not limited to drivers. There's already a Binder (Android's message bus) implementation, a 9P (network filesystem) implementation, and talks about LSM, parsers, and many others. C code can call into Rust code.
- Rust probably wouldn't have been added to Linux if it couldn't (at least in theory) be used in every part of the kernel. Expect a flurry of experimentations by the time 6.2 comes out, as people challenge this theory. Only a fraction of this will get proposed for mainline, but it's important to uncover any fundamental language issue early.
Comment