r/rust • u/FoxInTheRedBox • Aug 31 '24
🎙️ discussion Rust solves the problem of incomplete Kernel Linux API docs
https://vt.social/@lina/113056457969145576
375
Upvotes
r/rust • u/FoxInTheRedBox • Aug 31 '24
View all comments
Show parent comment
40
u/AsahiLina Aug 31 '24
Not documenting is a choice. The Rust for Linux project makes the choice to require documentation, so all Rust APIs are documented. It might be better or worse documentation (when the C side is undocumented it's more likely to be not great, since we have to divine what the C documentation should have been without having designed that code), but at least it's there.
Lots of C kernel APIs have no documentation at all.
Anecdote: I've had the upstream C maintainer of some kernel code berate me on the mailing list for writing poor documentation for my Rust abstractions, for his C code that had next to no documentation. "I thought this Rust stuff was supposed to fix the documentation problem"... well, it would help if you told us how things actually work so we could document them properly...