Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What about the commit message for the fix [0] makes you think this code, if it were written in say... rust, wouldn't have just been put in an unsafe block to do the "opportunistic" e.g. fast and dirty thing, anyways?

When your development practices normalize cheating here and there for performance wins where it matters, any language capable of writing kernels isn't going to stop you.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...



The wording `unsafe` makes it very obvious that it is supposed to be a method of last resort. In C, it is very easy to accidentally drift into undefined behavior, and reviewers have to be aware of all the potential issues, which can occur everywhere. Rust's `unsafe` blocks at least make it obvious where exactly dangerous things are going on so refers can focus their attention there. And the Rust compiler still performs many checks inside `unsafe` blocks, most importantly borrow checking.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: