4 ms·
I am so excited about rust slowly sneaking into the C territory. I am looking forward for the point in time when it is going to get to Linux kernel.
by vletal 6y ago
I am so excited about rust slowly sneaking into the C territory. I am looking forward for the point in time when it is going to get to Linux kernel.
- pilif 6y agosooner than you might think: https://lwn.net/Articles/829858/ https://lwn.net/Articles/829858/
- joseluisq 6y agoYeah, Barriers to in-tree Rust [video] → https://www.youtube.com/watch?v=FFjV9f_Ub9o&t=2045s https://www.youtube.com/watch?v=FFjV9f_Ub9o&t=2045s
- nindalf 6y agoThe biggest barrier is probably going to be the diff between architectures supported by Linux and those supported by Rust. It'll take several years for Linux to prune some of the lesser used architectures [1] and also years for Rust to add support on either LLVM [2] or via a WIP GCC frontend [3]. So while most people involved seem to supportive, including Torvalds and GKH, it will take time for any non-driver code to be written in Rust. [1] - https://lore.kernel.org/lkml/CAK8P3a2VW8T+yYUG1pn1yR-5eU4jJXe1+M_ot6DAvfr2KyXCzQ@mail.gmail.com/ https://lore.kernel.org/lkml/CAK8P3a2VW8T+yYUG1pn1yR-5eU4jJX... [2] - https://github.com/fishinabarrel/linux-kernel-module-rust/issues/112 https://github.com/fishinabarrel/linux-kernel-module-rust/is... [3] - https://rust-gcc.github.io https://rust-gcc.github.io
- wyldfire 6y agoLLVM just landed an experimental m68k backend, this week IIRC. That's some progress, anyways.
- littlestymaar 6y agoThis is addressed in the questions in the aforementioned video[1] and it's actually not that much of a blocker at this point. There's plenty of arch-specific stuff in the kernel (drivers, but not only), so Rust can (and will) be used there. And there's no point waiting for complete architecture compatibility before starting to deploy some Rust in the kernel. Of course it means that they aren't going to rewrite the core kernel logic in Rust tomorrow, but they wouldn't do it anyway even if GCC supported Rust. [1]: https://youtu.be/FFjV9f_Ub9o?t=2930 https://youtu.be/FFjV9f_Ub9o?t=2930
- joseluisq 6y agoAnother step forward to add Rust language support to the Linux kernel: https://github.com/Rust-for-Linux/linux https://github.com/Rust-for-Linux/linux
- simion314 6y agoMy opinion is that Rust community focuses on a new modern kernel, and emulate Linux op top if needed(like Windows does it). In theory you would get a cleaner architecture and cleaner code base, no need to worry about regression and you might finish the task in 10 years. Open source applications could run directly on top of this kernel and Linux closed source apps could run on the emulation/translation layer.
- littlestymaar 6y agoHow about the drivers though… There's already a Rust OS[1] built on top of a brand new Rust kernel, but even if it gets all the traction possible, it won't have proper hardware support before several decades (see the current state of Linux, which is better than ever, but still far from perfect). [1]: https://www.redox-os.org/ https://www.redox-os.org/
- simion314 6y agoYou will get some drivers at most, so maybe you could architect this drivers in such a way you could re-use part of teh code on the alternative kernels. What is missing is someone with big pockets to pay very competent engineers to work on such kernels full time and setup a decent test lab with different hardware. Hobbyist might take a long time to finish the job.