[M3devel] INTEGER
Mika Nystrom
mika at async.async.caltech.edu
Tue Apr 20 20:07:15 CEST 2010
Tony Hosking writes:
>On 20 Apr 2010, at 13:12, Mika Nystrom wrote:
...
>> easy access to the hardware in their own machines, not really so that =
>IBM
>> programmers could have an extra format for VAX compatibility. Note =
>that
>> I don't believe that it was intended that EXTENDED would be emulated =
>by
>> the compiler either: the point was really to give programmers access =
>to
>> the formats provided efficiently by their hardware.
>
>In the current implementation EXTENDED=3DLONGREAL.
Ok, but EXTENDED is still something that is efficiently provided by
my hardware. Not something efficiently provided by someone else's
hardware!
>> 4. I still haven't seen any really convincing use cases. What's it =
>for?
>> The lack of LONGINT was an obstacle to what, precisely?
>
>I think the only one we have is file sizes...
>
>> 5. Finally, is it the intention that LONGINT be fixed at 64 bits
>> forevermore? (See point 2.) This seems to completely fly in the face
>> of M3's philosophy. (See Hendrik's arguments.)
>
>The only constraint imposed is BITSIZE(LONGINT) >=3D BITSIZE(INTEGER).
I am not so sure here.
Rodney's argument has in fact convinced me that the current version of
LONGINT is wrong and perhaps evil. It should either go away completely
or be replaced by Hendrik's suggestion.
Here's why. The argument is that if I have an N-bit machine, for N<M,
out there in the world there is an M-bit machine that for some reason
matters a great deal to me. For some reason I need to be able to write
code that manipulates M-bit integers---because of the existence of this
M-bit machine (or machines)! (Normally we're dealing with the situation
that N=32 and M=64.) So we introduce an M-bit LONGINT. Now it stands to
reason that if the M-bit machine (which I do not own and upon which my
program does not run) is important to me, it is also important to other
Modula-3 programmers. Hence all other implementations of Modula-3 will
*also* provide M-bit integers.
The M-bit machine of the previous paragraph is of course, in the real
world, a machine with the 64-bit version of the Intel x86 instruction set,
"amd64". How long is it from here to the point where we have programmers
who write code that depends on the fact that M=64, always?
Mika
More information about the M3devel
mailing list