UB in Rust vs C
UB in Rust vs C
Posted Aug 14, 2024 22:18 UTC (Wed) by mb (subscriber, #50428)In reply to: UB in Rust vs C by khim
Parent article: Standards for use of unsafe Rust in the kernel
>Yes, but why?
It's not possible to encode such references in a sane way.
Yes, you can demand that the compiler would support it nevertheless. But then you have to pay for it.
Languages without UB exist and they are all slow for a reason.
>many C/C++ developers feel that the right to violate that bargain is their unalienable right!
Which I can actually understand and relate to, given the sheer amount of UB in these languages.
It's easy that the personal preference feels like the correct and obvious implementation to some UBs and then demand the compiler to read my mind.
