It amazes me that with all the focus on memory safety, most PLs still don't handle integer overflow sensibly by default: you either get guaranteed wraparound (which silently gives wrong values), or straight up undefined behavior as in C and C++. The latter won't change at this point, of course, but why do new designs insist on following their lead? Safety should always be opt-out, not opt-in.
And sure, overflow checks aren't free - but this is something that has been optimized in CPUs for decades.
And sure, overflow checks aren't free - but this is something that has been optimized in CPUs for decades.