3 ms·
When did Linus become ok with Rust in the kernel? Given that Rust can cause a panic, I thought he was adamantly against Rust for low level kernel support. htt
by alberth 5y ago
When did Linus become ok with Rust in the kernel?
Given that Rust can cause a panic, I thought he was adamantly against Rust for low level kernel support.
https://lkml.org/lkml/2021/4/14/1099 https://lkml.org/lkml/2021/4/14/1099
- fbanon 5y ago>When did Linus become ok with Rust in the kernel? He didn't. But he knows politics.
- jgilias 5y agoNote that this submission is about a learning project where someone aims to write a (minimal?) Linux ABI compatible kernel. To directly answer your question though. It's not that 'Rust memory allocations' panic. Rather it was the case that allocations widely used when the initiative was started could panic. This is being solved by writing a library with non-panicking memory allocations to be used in kernel development [1]. However, I'm not involved with this in any way, so I may be wrong. 1. https://rust-for-linux.github.io/docs/alloc/ https://rust-for-linux.github.io/docs/alloc/
- _flux 5y agoWork is being done to get rid of fallible code, such as allocations: https://www.theregister.com/2021/07/05/rust_for_linux_kernel_project/ https://www.theregister.com/2021/07/05/rust_for_linux_kernel... Anyway, I don't see paniccing as something a Linux kernel must never ever do. After all, we are all familiar with kernel oopses and panics, so clearly the existing body code already does it some situations. Just have the Rust code do that, if it wasn't its current behavior. One can argue Rust is one way to get rid of those panics/oops by e.g. statically guaranteeing a pointer is not null after a certain point.
- moltonel3x 5y agoHe (and other prominent kernel developers) has manifested his interest many times, but is taking a strict "wait and see" approach (as you would expect from any big project manager). Whether it happens or not, Rust has gotten closer to inclusion in Linux than any other language.