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

Wouldn't that bring a performance penalty though?


Yes.

But the current trade-off (performance always wins) means that kernels and other embedded-style programs cannot rely on the compiler doing the "reasonable" thing for UB because it's explicitly allowed to do whatever it wants (which is generally, try for better performance).

For kernel-style work, slightly lower performance but predictable/defined behavior for some of what is currently UB, makes life much simpler.


You don’t need to do what youre saying for that; Rust provides a way to get both performance and safety


Yes. Unless you use `unsafe`. Then the undefined behaviour rules gets even more difficult I'd say.


Sure, but we're talking about C.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: