Hacker News new | past | comments | ask | show | jobs | submit login

Why is having no carry flag "short-sighted"? Rather, it is dropping the unneeded historical baggage.

A carry flag was useful on an 8 bit CPU where you were constantly dealing with 16 bit and 32 bit numbers. On a 64 bit CPU it is almost never used, and updating it on every add is an absolute waste of resources.




Having integer operations wrap by default is a significant source of security issues, so having no other kind of addition and making it even harder to spot when it happens is not what my choice would be (I'd have both flags and trapping as options, at least). I should choose more charitable language.

I'd suggest that the unneeded historical baggage is default-wrapping integer operations, rather than carry flags. Back then, CPUs needed the simplicity.




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

Search: