[M3devel] 32bit host 64bit target TextLiteral recurring problem

Rodney M. Bates rodney_bates at lcwb.coop
Thu Jun 4 19:51:43 CEST 2015











On 06/04/2015 11:50 AM, Antony Hosking wrote:
>
>> On Jun 4, 2015, at 11:45 AM, Jay K <jay.krell at cornell.edu <mailto:jay.krell at cornell.edu>> wrote:
>>
>>  How strongly preferred and why?
>
> TInt preferred because LONGINT is still a terrible hack, and I hate to see it pollute the system more than it already has.
> What’s more, the backends break on a number of operations for it.

Danger, Will Robinson! This could introduce truly show-stopping bootstrap problems, using LONGINT in the compiler,
and in places essential to its ability to function at all.  One little bug and we could end up with neither a chicken nor an egg.

 > I now regret ever having introduced it, and would like to back it out.  We would have been better to specialize 32-bit targets to treat 64-bit offsets as ARRAY [0..1] OF INTEGER, and then hidden manipulation of those offsets behind a clean interface, much as Tint does.  I think the one use-case we had for it to allow interfacing directly to C functions that take offset_t arguments could have been finessed differently.
>
>>  good naturedly:
>>
>>
>>   1) to cause me pain so that might give up?
>>   2) to take more time so I don't muck with other stuff?
>>   3) for compatibility with older releases?
>>   4) for easier extension in future?
>>   5) to cause me pain so I whine more about wanting operator overloading?
>
> Perhaps 3 & 4.
>
>>  I started this once and it going to be a pain.
>>  LONGINT is probably much easier.
>>  Maybe I have more patience now.
>
> :-)  Patience accrues with age…
>
>> Extension in the future could be addition of INTEGER128 to the language. :)
>> And the 128 bit targets will initially have 64bit LONGINT limits, until we add INTEGER128
>> and convert frontend to use it. Hypothetically. Perhaps before that happens
>> we'll have operator overloading. :)
>
> Operator overloading is anathema to the Modula-3 design principles.  Use C++ if that is what you want.
>
>>
>>
>>  - Jay
>>
>>
>> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ---
>> Subject: Re: [M3devel] 32bit host 64bit target TextLiteral recurring problem
>> From: hosking at purdue.edu <mailto:hosking at purdue.edu>
>> Date: Thu, 4 Jun 2015 11:32:48 -0400
>> CC: rodney.m.bates at acm.org <mailto:rodney.m.bates at acm.org>; m3devel at elegosoft.com <mailto:m3devel at elegosoft.com>
>> To: jay.krell at cornell.edu <mailto:jay.krell at cornell.edu>
>>
>> Again, TInt preferred.
>>
>> Sent from my iPhone
>>
>> On Jun 4, 2015, at 11:08 AM, Jay K <jay.krell at cornell.edu <mailto:jay.krell at cornell.edu>> wrote:
>>
>>     When I proposed TInt I had actually forgotten about LONGINT!
>>     LONGINT is easier to code to (until/unless we get operator overloading...)
>>
>>     TInt is easier to extend, and is portable to before the current release.
>>     I think LONGINT is adequate.
>>     I did extent TInt to 72 bits I think.
>>
>>      - Jay
>>
>>
>>     > Date: Thu, 4 Jun 2015 09:37:06 -0500
>>     > From:rodney_bates at lcwb.coop <mailto:rodney_bates at lcwb.coop>
>>     > To:jay.krell at cornell.edu <mailto:jay.krell at cornell.edu>;hosking at purdue.edu <mailto:hosking at purdue.edu>
>>     > CC:m3devel at elegosoft.com <mailto:m3devel at elegosoft.com>
>>     > Subject: Re: [M3devel] 32bit host 64bit target TextLiteral recurring problem
>>     >
>>     >
>>     >
>>     > On 06/03/2015 06:14 PM, Jay K wrote:
>>     > > sorry, I missed that it is literals...so I can convert a blueray movie into a source file containing the data all in a text? Far fetched.
>>     > > An array of chars? Probably has same problem.
>>     > >
>>     > >
>>     > > Can I/we please LONGINT-ize the compiler now, for all type sizes and field offsets?
>>     > >
>>     > > - Jay
>>     > >
>>     >
>>     > I'm OK with doing it, but I thought you had been talking about using TInt.
>>     > Would that be better? It would be more general. But LONGINT would be
>>     > faster at compile time, and less work, since the arithmetic operators
>>     > would not need to be changed to TInt function calls. There might
>>     > be quite a lot of those I guess the compiler would be of about equal
>>     > help in finding missed places to be changed, either way.
>>     >
>>     > I just checked, and LONGINT is in the release compiler, contrary to
>>     > my sense of relative history, so there would be no bootstrap barrier.
>>     >
>>     > Either would allow a 32-bit hosted compiler (cross- or native-) to handle
>>     > types whose byte-count approached 2^31, instead of just 2^23. With a
>>     > 64-bit hosted compiler, TInt would handle 2^63 byte-sized objects,
>>     > whereas LONGINT would only go to 2^55. Do we really care?
>>     >
>>     > >
>>     > >
>>     > >
>>     -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 -----
>>     > --
>>     > > Subject: Re: [M3devel] 32bit host 64bit target TextLiteral recurring problem
>>     > > From:hosking at purdue.edu <mailto:hosking at purdue.edu>
>>     > > Date: Wed, 3 Jun 2015 14:07:02 -0400
>>     > > CC:m3devel at elegosoft.com <mailto:m3devel at elegosoft.com>
>>     > > To:jay.krell at cornell.edu <mailto:jay.krell at cornell.edu>
>>     > >
>>     > > It’s only TEXT /literals/ that are limited here. As in, what appears in a source program.
>>     > >
>>     > >
>>     > --
>>     > Rodney Bates
>>     >rodney.m.bates at acm.org <mailto:rodney.m.bates at acm.org>
>

-- 
Rodney Bates
rodney.m.bates at acm.org



More information about the M3devel mailing list