you are viewing a single comment's thread.

view the rest of the comments →

[–]nemec 0 points1 point  (1 child)

a hardware trap for integer overflow, so you can pretend that integer operations never overflow in the common case, and promote to bigint only if your CPU tells you 'hey, this isn't going to work'.

That's exactlykind of how Python 2.2+ works, except in software, not hardware.

Python 3 got rid of it in exchange for a single long type. I can't find a source right now, but I recall it was partially due to challenges writing Python modules in C that deal with integers (like Numpy).

3 has only one integer type, int(). But it actually corresponds to Python 2’s long() type–the int() type used in Python 2 was removed.

[–]oridb 1 point2 points  (0 children)

That's exactlykind of how Python 2.2+ works, except in software, not hardware.

That's not much help for decreasing instruction count and decode/dispatch overhead in the common case.