10 ms·
I can't help but feel most of these bugs and vulnerabilities in the Linux kernel could be avoided with a more robust foundation than C. It's nice to see that Ru
by gnode 7y ago
I can't help but feel most of these bugs and vulnerabilities in the Linux kernel could be avoided with a more robust foundation than C. It's nice to see that Rust is starting to be tolerated in the Linux kernel for modules.
It would be nice to see an effort to migrate some of the kernel core, but I can't see Rust gaining widespread acceptance in the kernel development community any time soon.
- rvz 7y ago> It would be nice to see an effort to migrate some of the kernel core, but I can't see Rust gaining widespread acceptance in the kernel development community any time soon. I don't even think that a migration effort from C -> Rust for the Linux Kernel is even feasible or even worth it, given the scale of the project. At this point, you might as well start from scratch. Google is already experimenting with Rust for OS development with their new Fuchsia operating system [0], which has some drivers written in Rust with a capability based security model. [0] https://fuchsia.dev https://fuchsia.dev
- gnode 7y agoDeveloping a new kernel or operating system in Rust is a good idea, but a massive undertaking, and it's hard to see it gaining adoption quickly. I think a more credible way to benefit from Rust in the short term is to rewrite small but critical components of existing kernels, or adopt Rust components from experimental Rust OS projects. Similarly, Firefox's Project Quantum seeks to bring Rust to Firefox from the more experimental Servo project.
- berbec 7y agoI think one of the reasons OSs are written in low-level, shoot-yourself-in-the-foot ready languages is sometimes you need to do truly stupid things to make stuff work. Hardware doesn't do what it's supposed to and getting around it via some nutty hack is the way the world works.
- alkonaut 7y agoRust for OS development has a pretty big following, even though there are no large production kernels (yet) obviously. There are 2 reasons the Linux kernel in particular uses C and will continue to use C: 1) it was C originally and 2) it should compile without requiring some other compiler. Anyone who sets out to write a new OS kernel (or similar) today for platforms where Rust is available, would probably/hopefully use Rust over C. That doesn't mean it's a good idea to start making existing code bases "hybrids". No one wants a huge codebase where to build it you need N compilers for languages that were popular in various times during the code bases hisory, and where you need to be an expert in N languages to maintain it.
- eloff 7y agoRust wouldn't fix these problems. They exist, at least some subset of them because the kernel needs to do low level concurrency and lock free algorithms. That's all unsafe code in Rust. So assuming you got the buy in and managed to scrape together enough engineering talent for a mammoth task, it wouldn't help much with these kinds of issues.