[M3devel] A "radical" proposal: drop LONGINT
Rodney M. Bates
rodney_bates at lcwb.coop
Wed Jan 6 18:49:46 CET 2010
Tony Hosking wrote:
> But my question is what are the current use-cases for LONGINT? Do they
> justify retaining it?
>
I want to code stuff that requires arithmetic in > 2^32 range, and be
portable between 32- and 64-bit targets. Using a record with two
INTEGERs on 32-bit machines and INTEGER on 64-bit machines would require
a lot of code differences between the targets, and the differences
can be pervasive.
OTOH, using the record on all machines will not take advantage of native
64-bit arithmetic when available.
Encapsulating the arithmetic in function calls also would add a lot of
overhead, unless we had a compiler that would inline them, which, as
I understand, we do not. It's also not as readable. I am a staunch
opponent of adding user-definable operator overloading to get this
readability advantage, because it interacts with all kinds of things
and makes the language just absurdly overcomplicated. But LONGINT
arithmetic is language-defined and highly constrained overloading,
so the language complexity impact is much less.
>>>
>>> Antony Hosking | Associate Professor | Computer Science | Purdue
>>> University
>>> 305 N. University Street | West Lafayette | IN 47907 | USA
>>> Office +1 765 494 6001 | Mobile +1 765 427 5484
>>>
>>>
>
More information about the M3devel
mailing list