Is that even possible as long as the Linux kernel is written in C? I wonder if telling people not to learn C will have a long-term effect on being able to find competent contributors to the kernel.
Apologies, I can't find a source. I probably read it on LWN somewhere. Linus wouldn't dip both feet into the water at the same time. I'm confident he's said that the kernel needs to be buildable without Rust if need be.
A significant amount of the lines of code in the kernel are for drivers (7 of 12 million lines?).
A potential strategy would be to set a date where any new drivers must be written in Rust. Deprecate every non-Rust driver on a date after that. Focus on rewriting only the drivers necessary for current hardware platforms (and some sensible/arbitrary cut-off going back x years). Then set a final deadline for a New Linux kernel release that removes all deprecated/C drivers.
I would blindly estimate that entire process to take 10-20 years (not including the time needed for debating the whole thing).
Then somebody "just" needs to rewrite the rest of the code.
They said a C-free build. For that you'd need to "just" rewrite the core kernel, which will be 150-200k lines, and the drivers + arch specific parts for one system. Still a tall order, but a decade isn't unrealistic if Rust proves itself.
Now, rewriting everything, including all the legacy drivers? Yeah, never happening even if Rust succeeds utterly.
Maybe there's a case to be made for a multi-language kernel. Rust is the first step. Maybe it'll make sense at some point to keep Rust, but add another language.
I don't see such a feat taking place in the next decade, you need highly dedicated people. I can see new code being written in Rust but a C free build sounds like something that really won't be happening anytime soon.
I wish something like it could happen, but I am causyiously optimistic.
As long as there isn't a Rust compiler written in Rust (there is a transpiler to LLVM bytecode, but that gets compiled by a C++ compiler, same for GCC-rs) I don't think a C-free (or a C++-free) build will be possible at all, so I'm guessing it'll take somewhere in the 60-100 year range.
Honest question: what would the engineering rationale be behind dropping LLVM entirely and have rustc have its own code generation backend? There are two out there that might be interesting, one uses gcc and another is called cranelift, but it isn't the default and focuses exclusively on compilation speed for debug binaries.
Well people keep telling me that C/C++ code should be replaced by Rust for ~safety~ reasons, and LLVM is a C++ project, so...
Let's say it would avoid all the memory bugs in LLVM, that would doubtlessly make it worth throwing away the LLVM implementation (avoid sunk cost fallacy).
The Linux kernel comes with many old drivers that modern programmers have little knowledge about. It is probably more realistic to write a new kernel in rust (like Redox), targeting modern machines only.