Re:Linus Torvalds on Rust support in kernel
by steveklabnik on Friday April 16, 2021 @09:36AM
(#26833686)
Doing this well requires a heavy enough runtime that it would disqualify it for this kind of work. Not on a technical level, but on a social one. While there have been operating systems created with this sort of runtime, they're not as well known or successful as ones that haven't. I would imagine this email would be a flat "no" if this were a core part of Rust, sadly.
[ Parent
| on HN ]
Re:Linus Torvalds on Rust support in kernel
by staticassertion on Friday April 16, 2021 @12:11PM
(#26835699)
> a heavy enough runtime
Hey, asking out of pure ignorance - Why do you think this? My naive point of view is that the Linux kernel already has enough of a runtime to support such at hing - a scheduler, kernel threads, and interrupts.
An actor system shouldn't be particularly heavy - you can probably implement an actor in just a couple of bytes.
Agreed that it couldn't be a core part of Rust though.
Maybe it's too off topic or whatever, just curious.
Re:Linus Torvalds on Rust support in kernel
by steveklabnik on Friday April 16, 2021 @12:30PM
(#26835961)
Erlang makes heavy use of green threads to do this kind of work. You spin up thousands or hundreds of thousands of these. Kernel threads are too heavy weight to do so. And making them lighter weight has tradeoffs too. Erlang makes use of a GC and immutability to make tasks more restart-able; maybe Rust's memory safety features would let you do this sorta kinda, but I don't think it's been really demonstrated fully yet.
Like sure, you could build out some of these features, but they only truly work really well if you extremely commit to the architecture, in my opinion. And the kernel isn't about to do that.
Re:Linus Torvalds on Rust support in kernel
by staticassertion on Friday April 16, 2021 @12:36PM
(#26836036)
Oh yeah, I 100% do not believe this would be something that ships to the kernel :)
Re:Linus Torvalds on Rust support in kernel
by acomjean on Friday April 16, 2021 @10:37AM
(#26834415)
From what I remember the Linux kernel doesn’t even use std.lib. It’s pretty straight up C with no dependencies (the os being low level). Makes kernel module programming difficult.
Re:Linus Torvalds on Rust support in kernel
by SubjectToChange on Friday April 16, 2021 @01:27PM
(#26836716)
The Linux kernel is freestanding. But that's hardly the reason why kernel programming is difficult.