4 ms·
You would also need to comprehensively annotate the Linux C headers in order to provide the information that Rust expects (e.g. for each ptr instance whether it
by zozbot234 6y ago
You would also need to comprehensively annotate the Linux C headers in order to provide the information that Rust expects (e.g. for each ptr instance whether it's a "raw" pointer, a shared/exclusive reference or a piece of "owned" data, whether it can be NULL etc. etc.). This might actually get accepted upstream though. Having the kernel-build itself depend on Rust could be far more problematic, given e.g. the variety of hardware that Linux must support.
- TheDesolate0 6y agoNot only that, but Rust depends on LLVM.
- saagarjha 6y agoIt doesn't have to, but yes, it currently pretty much requires LLVM.
- dijit 6y agoLast time I looked at this comment it was flagged [dead]; I'm glad someone was able to remedy that as I was unable to upvote. I think this is a good criticism, but might not be true forever and is certainly something to keep in mind. As I said in the GP, Rust will not be upstreamed into the kernel- this is one of the reasons why.
- ufmace 6y agoI would think such a thing would be more like "compiling" rust to C. As in the C code would have no means to maintain most of the safety guarantees, rather they would be verified at compile time, and the produced C would be meant to be used unchanged. So as long as nobody ever edits the C manually, it would still presumably be safe.
- phkahler 6y agoThat's what I really meant. Write it in Rust but then output C instead of ASM. The parent is right though. A component/driver would need to use the C headers from the Rust side.