[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Bignums in core

From: John Cowan
Subject: Re: [Chicken-users] Bignums in core
Date: Sun, 4 Oct 2009 01:39:41 -0400
User-agent: Mutt/1.5.13 (2006-08-11)

Kon Lovett scripsit:

> I am not defending the lack of bignums in Chicken. Just trying to  
> understand the need.

I think at this point it's about what people expect from a Scheme.
Of the pre-R6RS implementations I tested, all of PLT, Gauche, MIT Scheme,
Gambit, Bigloo, Scheme48/scsh, Guile, Kawa, SISC, Chez, SCM, STklos,
and even tiny Chibi provide bignums.  In effect, bignums have become
part of what a Scheme is.  Most of these systems limit bignums in one
way or another to a size far less than all of memory, but all of them
AFAIK handle numbers up to at least 2^(2^15).

Scraping the bottom of the implementation barrel, SigScheme has 28-bit
fixnums and signals an error if you overflow them; however, bignum
literals are interpreted as flonums.  SXM and S7, which are extremely
minimal, wrap at 31 bits and 64 bits respectively, which is not even
R5RS-conformant; SXM actually crashes if it reads a bignum literal.

Chicken and only Chicken converts fixnum operations to flonums on
overflow.  This behavior is certainly licensed by R5RS, but it doesn't
fit very well into the Scheme ecology.  The numbers egg just isn't a
substitute for bignums in the core (and particularly in the FFI).

Normally I can handle panic attacks on my own;   John Cowan <address@hidden>
but panic is, at the moment, a way of life.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]