|
|
|
|
|
by ristos
633 days ago
|
|
Can anyone explain to me why these two issues aren't considered deal breakers for introducing Rust into the kernel? 1. It doesn't map almost 1:1 to assembly the way C does, so it's not inherently clear if the code will necessarily do what it says it does. That seems questionable for something as important as a kernel and driver. 2. Only one real Rust compiler, that's a recursive compiler, which reminds me of the Trusting Trust problem:
https://dl.acm.org/doi/abs/10.1145/358198.358210 |
|
As someone who works on a C compiler, I will tell you that Rust maps marginally better 1:1 to assembly than C does. No major C compiler goes 1:1 to assembly; it all gets flushed into a compiler IR that happily mangles the code in fun and interesting ways before getting compiled into the assembly you get at the end. Rust code does that too, but at least Rust doesn't pull anything silly on you like the automatic type promotion that C does.
If C maps 1:1 to assembly in your view, then (unsafe) Rust does; if Rust doesn't map 1:1 to assembly, nor does C. It's as simple as that.