r/linux • • Apr 15 '21

Kernel Rust in the Linux kernel

https://security.googleblog.com/2021/04/rust-in-linux-kernel.html
103 Upvotes

66 comments sorted by

View all comments

-25

u/[deleted] Apr 15 '21

[removed] — view removed comment

14

u/eXoRainbow Apr 15 '21

Its a slow transition without changing everything and breaking everything. This possibility is also a feature and goal of Rust developers. From that point, they can start using other Rust features and go upwards. The doc-comments are not the reason for the switch, but one advantage they can use right away in their code base.

Not sure why you mark this quote as a gem, as this is a very common tactic when big changes are done. Go step by step.

-16

u/[deleted] Apr 15 '21

[removed] — view removed comment

3

u/TDplay Apr 15 '21

Rust has compiler-checked compile-time memory safety. All potential memory safety issues will be found in unsafe blocks, rather than being strewn all around the codebase. Good luck implementing that in C.

Yes, GCC has -fsanitize=memory, but that's a runtime check and doesn't stop the bug from happening in the first place.

While C is a great language (which will probably never be replaced entirely), it's not the language for every job. Low-level code will probably never move away from C (low-level code in Rust ends up with unsafe blocks strewn everywhere, which completely defeats the point of Rust), but higher level code can actually benefit from the language.