bignums in a reflective system

Fare Rideau rideau@ens.fr
Wed, 14 May 1997 17:18:24 +0200 (MET DST)


[It seems to me that I already answered this mail]

>>>>: Henry G. Baker
>>>: Kalman Reti
>>: Fare Rideau
>: Kalman Reti

>>>> I agree that complex numbers should _not_ be part of 'basic'/primitive
>>>> Lisp, but it should be possible to program them as a library package
>>>> on top.  Ditto for bignums.
>
>>> You might want to reconsider on bignums.
>>> A single large file on a big disk these
>>> days overflows 32 bits in byte length.
>>>
>> So what?
>
> My point is that there are numeric values
> that you plausibly might need to store
> or manipulate as part of the operating system
> which exceed the size of typical
> lisp implementation fixnums,
SURE! No one pretends the contrary.

> hence the basic system might want to contain them.
NO!!! because those parts of the OS that need non-basic types
are not basic themselves, these parts can very well use non-basic packages.
   It's as if you required built-in types in the basic language to support
sound, pictures, "multimedia", monetary units, timestamps, time periods,
physical units, URLs, "virtual-reality", symbolic mathematics,
PGP signatures, regular expressions, first-class whatever, etc.
Yet, *essential* parts of the OS will have to deal with all these things
at some point. Just that *essential* != *basic*.
   See www.REBOL.com for a language with lots of such "niceties" builtin.
As for me, I'll keep the basic lisp as simple as possible:
all these types can be implemented as reflective extensions to the basic lisp.
Once a type has been implemented, you can use it as if it were builtin,
by using the right package; however, it won't be a burden to everyone,
you can get a better implementation elsewhere, etc.


> Another example is a universal time.
Perhaps you also want that the basic time type also manage time addition,
Julian calendar, Chinese calendar, Saints days, leap seconds,
legal corrections according to all countries on earth, and martian time?
Will you take relativistic effects into account?
Well, perhaps that's what you want.
Personally, I'd keep all that in extension packages,
which will make the basic lisp smaller, and allow for far more features
to be implemented (as packages) than with a stubborn basic type.
Another advantage is that I won't have to recompile the whole system
when a parliament modifies summer/winter time
(I've seen Solaris administrators reinstall thousands of machines for that):
I'll just modify the time handling package,
and introduce an filter for compatibility with earlier versions.

> If you are going down to the bare hardware,
> you have to decide how to store and manipulate things
> like file-size, creation-date etc.
>
*I* don't have to decide. The compiler has.
I just have to define low-level implementations of functionalities,
and give minimal hints to the compiler.
The compiler is a big boy, and knows how to convert between numerical types,
and wrap a high-level interface around a well-described low-level function.


>> I hope your don't mean that Get-file-length should be basic/primitive???
>> In the reflective system we want, it won't be,
>> so there's no problem with having
>> it return a non-primitive type like bignums
>> (or long long ints, for that matter).
>
>> The trap: basic != standard.
>> There can very well be a non-so-standard basic system
>> used to build standard non-basic system on top...
>
This is still valid.

== Fare' -- rideau@ens.fr -- Franc,ois-Rene' Rideau -- DDa(.ng-Vu~ Ba^n ==
Join the TUNES project for a computing system based on computing freedom !
                TUNES is a Useful, Not Expedient System
URL: "http://www.eleves.ens.fr:8080/home/rideau/Tunes/"