Conversation

This Tweet was deleted by the Tweet author. Learn more
It's meant to bother people. It was intended to add friction to depending on wrapping and to keep people aware that it's a bug to have unmarked overflows. The language can't accept the significant cost of having overflow checks enabled by default today but wants to do it later.
2
That's not the kind of hardware support I'm talking about. You can enable overflow checking and see for yourself that it has a significant performance and code size cost despite using the available intrinsics / hardware support.
1
Having overflow checks for all arithmetic operation blocks many other optimizations which hurts much more in idiomatic Rust than C. Branches and larger code size hurt overall performance by wasting global resources. The bounds checks are already expensive but not quite as bad.
1
MIPS has trapping versions of the arithmetic instructions so it avoids extra code size but that would likely still have a fair bit of overhead in a modern CPU and the compiler would still miss optimizations. A lot of work needs to be done to eliminate the overhead.
2
Show replies