[M3devel] Unbounded but finite LONGINT (was: Re: Integers

Tony Hosking hosking at cs.purdue.edu
Sat Jan 9 03:32:47 CET 2010


On 8 Jan 2010, at 20:33, hendrik at topoi.pooq.com wrote:

> On Fri, Jan 08, 2010 at 07:53:07PM -0500, Tony Hosking wrote:
>> I think what you are advocating is Rodney's proposal + assignability 
>> of INTEGER and LONGINT + mixed arithmetic.
> 
> I thought Rodney's propsal still had the compiler impose a bound on the 
> size of LONGINT.  Or did I miss something?

Yes, it would.

> I'm proposing to let the programmer use subranges of LONGINT that are as 
> long as he wishes.  And if the computer runs out of virtual memory to 
> store one of the programmer's long integers, well, that's the computer 
> imposing the limit, not the language.

But there is still the question as to what *representation* is used to decide the particular operation to apply.

I suppose the compiler could choose a particular machine representation based on the range of values in the subrange (much as it does currently).
But if you really want to have an arbitrary range type I would argue it is much better to implement it as a library than as a primitive type.

Just for fun, I suggest you take some time to watch the talk Growing a Language, by Guy Steele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100108/f9495a09/attachment-0002.html>


More information about the M3devel mailing list