[M3devel] 64bit INTEGERs, WIDECHAR: language specified or configuration/target dependent?

mika at async.caltech.edu mika at async.caltech.edu
Wed May 27 18:17:17 CEST 2015


...
>> Whether types like integer have a language-specified or =
>target-dependent
>> range is a tough language design question.  I have tended to favor a
>> fixed, language-specified range, but there are pros and cons.  I do
>> think all the time about end-of-range cases and native word size =
>dependencies.
>> It takes a great deal of care, and I know of no way to design a =
>language
>> that doesn't, to some extent, trade one set of problems for another.
>> Signed/unsigned creates similar language dilemmas.
>
>* language-specified or target-dependent
>As I have already suggested I believe there is some justification to =
>have
>both kinds of type: a language dependent type and a target dependent one
>
>The advantages of a language dependent type are rather clear when it
>comes to mere INTEGERs for numeric/counting/calculation purposes. Once
>you have a fixed size you can rely on support of a certain value range.=20=

Hmm?

Modula-3's INTEGERs are the "integers" of mathematics.  The intent is
that if your implementation is limited and doesn't support a particular
operation because it goes out of range, your computation aborts.  Same
as any other implementation limitation.

There is no reason I can think of you couldn't come up with an implementation
that has unlimited-range integers.  FIRST(INTEGER) and LAST(INTEGER) would have
to be a little special.

     Mika



More information about the M3devel mailing list