[M3devel] 64bit INTEGERs, WIDECHAR: language specified or configuration/target dependent?
Jay
jay.krell at cornell.edu
Thu May 28 18:16:48 CEST 2015
Arbitrary fixed width integers in the language? Kinda nice.
1. Bits X for integer? Why call it longint? Make the range affected?
2. Once you have operator overloading these language debates fall away and become easier but still non-trivial library debates.
Similar thing happens with strings, complex numbers, arrays. Stuff that people like to build into languages because the language can't accommodate writing efficient easy to use libraries. Mutexes too but due to other language features (stack allocated classes with destructors).
Even hashtables benefit, from operator[].
Maybe worth evolving the language this way?
Name overloading too. e.g. You want String.Plus(char) and String.Plus(string).
- Jay
On May 27, 2015, at 9:14 AM, Hendrik Boom <hendrik at topoi.pooq.com> wrote:
> On Wed, May 27, 2015 at 09:17:17AM -0700, mika at async.caltech.edu wrote:
>>
>> 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.
>
> That was, in essence, my proposal for LONGINT, not for INTEGER.
> We still need an integer length that's efficient. I wasn't proposing to
> change the definition of INTEGER, FIRST(INTEGER), and so forth.
>
> But if one had a base tyoe of LONGINT and forbade declaring anything of
> type LONGINT, you could still have BITS 45 FOR LONGINT and the like.
> It just happens that the usual arithmetic operations are bounded in
> nature -- the number of bits in the result are bounded by functions of
> the numbers of bits in the operands, and an assignment so assigning
> to variable of could end up truncating, possibly with an overflow
> check.
>
> In fact, one could possibly define INTEGER to be BITS 32 FOR
> LONGINT, but that might involve further consequences in corrner
> case in the language.
>
> -- hendrik
>
>>
>> Mika
More information about the M3devel
mailing list