Rust in the Kernel 23 October 2022, 03:50:43 So apparently Rust will be an acceptable language to use for driver module submissions in the kernel soon. It doesn't seem to be BS, https://docs.kernel.org/rust/index.html. From what I gather it's a push by Google, Amazon and Microsoft. That's a huge change.I think that if Firefox, the birth project of Rust bugs out into oblivion within a week of being open and still hasn't been fixed, it's mind blowing that it should even be considered. It doesn't have gcc support, no open standards, no expansive ecosystem like C++ and it doesn't play well with other languages, so lacking everywhere. If it has any good features, port them to C we don't need new toolchains. Though on the other hand I do C and have little experience with Rust. At least allow C++ driver modules if you are to allow Rust ones, that ecosystem surely has something to offer.What do you guys think?
Re: Rust in the Kernel Reply #1 – 23 October 2022, 05:42:21 Mozilla turned Rust over to a foundation such that the language is no longer dependent on them. https://foundation.rust-lang.org/ 1 Likes
Re: Rust in the Kernel Reply #2 – 23 October 2022, 08:23:29 Quote from: AndBenn – on 23 October 2022, 05:42:21Mozilla turned Rust over to a foundation such that the language is no longer dependent on them. https://foundation.rust-lang.org/Any particular opinions on it's inclusion in the kernel?
Re: Rust in the Kernel Reply #3 – 23 October 2022, 09:31:19 Quote from: armchaircommander – on 23 October 2022, 08:23:29Any particular opinions on it's inclusion in the kernel?Me? I've got nothing that could add value that hasn't already been said. The proposal came up ~July 2020, so Rust's inclusion has been pretty well thought over since then. A lot of work has happened to get here and a ton of future work yet to do.
Re: Rust in the Kernel Reply #4 – 23 October 2022, 18:45:20 One really important thing people have to understand: Rust kernel programming is not the same as Rust userspace programmingAccording to this page from Redox OS, You cannot write a kernel without unsafes.Now I don't exactly know if this applies to kernel modules, but since that stuff also counts as low level, I'm guessing it does.Rust loses some of its safety features when using unsafe so that you can gain some additional capabilities to write low level code: https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html Last Edit: 24 October 2022, 14:37:16 by Lancia 1 Likes
Re: Rust in the Kernel Reply #5 – 23 October 2022, 20:20:15 Quote from: Lancia – on 23 October 2022, 18:45:20One really important thing people have to understand: Rust kernel programming is not the same as Rust userspace programmingAccording to this page from Redox OS, You cannot write a kernel without unsafes.Now I don't exactly know if this applies to kernel modules, but since that stuff also counts as low level, I'm guessing it does.Rust loses some of its safety features when using unsafe so that you can gain some additional capabilities to write low level code.Yeah apparently the NVME driver they wrote in Rust to prove you can write Rust drivers comparable to C used unsafe in all the tricky parts.