logoalt Hacker News

umanwizardtoday at 3:34 PM2 repliesview on HN

Signed overflow being UB (while unsigned is defined to wrap) is a quirk of C and C++ specifically, not some fundamental property of computing.


Replies

xigoitoday at 3:36 PM

Nim (the original one, not Nimony) compiles to C, so making basic types work differently from C would involve major performance costs.

show 2 replies
Symmetrytoday at 4:06 PM

Specifically, C comes form a world where allowing for machines that didn't use 2's compliment (or 8 bit bytes) was an active concern.

show 1 reply