Can LLMs help here with code (re)writing?
Whether Rust in the kernel succeeds or not will likely be determined by whether or not a sufficiently clear boundary can be drawn between the bit that must be unsafe (in the Rust sense) and the rest. And how much code is in the latter. I don't think we know the answer yet but some knowledgable people are willing to run the experiment on the basis that the probability seems quite high that a safe subset can be determined.
In the LLM case mentioned, having to hop a syscall every few teraflops is probably not a compelling reason to live in kernel space.
If you're talking about option A) or B), we already have things like mrustc and c2rust. These are though problems, LLMs aren't _that_ smart yet.
If I'm not mistaken, the first stable Firefox releases including notable usage of Rust code came out in late 2017. So that's about 6 years of Rust in Firefox.
From a Firefox user's perspective, I can't say that I'm impressed by it.
Building Firefox from source is more involved than it was before. As you mentioned, additional tooling for Rust is required in such a situation.
I haven't really noticed any real Firefox feature, functionality, or performance improvements that I could directly attribute to the use of Rust.
It also doesn't seem like using Rust has allowed the Firefox developers to be significantly more efficient or productive than they were before.
Maybe an argument could be made that some security issues, for example, have been avoided thanks to Rust, but that's not really provable in any meaningful way.
After seeing the Firefox situation, my expectations for the use of Rust in the Linux kernel are pretty low.
Google has some pretty good data on this: https://security.googleblog.com/2022/12/memory-safe-language...
As for Firefox, the CSS engine was rewritten to be parallel, among other improvements (new wasm compiler, new parallel compositor) that would have been challenging without Rust: https://wiki.mozilla.org/Oxidation
> but that's not really provable in any meaningful way.
Can you prove that Rust didn't make developers more productive?
Also, that there are less memory bugs in Rust then in C++ is just common sense and pretty generally accepted. It doesn't need to be proven again for every project.
> After seeing the Firefox situation
The situation where more and more code is written in Rust because most people prefer it?
Multi-core CSS engine and GPU-accelerated rendering in Firefox are in Rust. Without them Firefox was really behind in performance (if you're unimpressed now, imagine it being way worse).
Before Rust starts getting used "for real" in the kernel there's a lot of barriers to overcome. Most maintainers aren't hugely proficient in Rust and absolutely do not have the time to learn. Needing yet another toolchain is annoying (especially when you need bits that aren't in stable yet), anything you write in Rust probably won't get built in distro kernels for a long time, and anything you work on today is hugely uncharted territory since it's all so new.
I think one thing a lot of people don't understand from "outside" the kernel development sphere is that standards for getting stuff upstream are typically pretty high for most subsystems, a lot higher than most open source projects. There are a lot of open questions about Rust in Linux that don't have clear answers, and Linux really struggles with consensus. Yes it has a dictator, but that dictator very rarely dictates anything that hugely moves the needle.
I do think "real" kernel bits written in Rust will get upstream and will get used, but it will be a very slow burn.