> Is it technically possible to write a driver in Rust and add it to the kernel in a reasonable way? That is, without gobs of fragile shims, etc.
I think this is highly unlikely. The Linux kernel lacks an internal ABI [0] which would make writing drivers in a different language and targeting them at multiple kernel releases essentially impossible.
Many, many people and organizations writing drivers have complained over the years about the lack of an internal ABI. [1] [2] I would go so far as to say it's why Linux on ARM is such a dumpster fire. SoC vendors provide an SDK based on a certain kernel, and OEMs forever ship this kernel (with occasional backports for really severe bugs) because porting the device-specific changes to a newer kernel is just too much effort.
Google created their own Linux driver ABI with Project Treble.
Basically, it transforms Linux into a kind of microkernel, with drivers being implemented on their own processes, using shared memory APIs to talk with the kernel, based on an IDL (Interface Description Language).
Why do you think ABI compatibility is needed for wiring drivers in Rust? ABI compatibility is only needed for binary modules. Source compatibility should be enough for source code form.
Yes, Mozilla is doing just that for Firefox, and there are lots of demo projects. (There's even a minimal kernel example I have bookmarked somewhere...) The problem is that once you accept that, you open the door for many other languages that are arguably better than C and can be introduced piecemeal just as well. Like Nim, but others too. Now you have to decide which one you want to use, evaluate their various merits, it's not just a "use this hip one that pops up on HN every week". It's easier to just keep everything in C and propose out-of-band ways of making things better. (e.g. I don't think there are any unit tests in vanilla Linux but it wouldn't surprise me if there's a bank of unit tests some other groups have written to occasionally run the latest vanilla against. People have found bugs with fuzzers. Etc.)
Is it technically possible to write a driver in Rust and add it to the kernel in a reasonable way? That is, without gobs of fragile shims, etc.