Ralf Hemmecke wrote:
> > using Ralf's branch rev 338 + a few patches from Martin.
> > The build goes through, including aldor.
> 
> Well, I a really still unsure whether Martin's patch moving away from 
> fixnum (29bit) to (integer ... ...) (32bit) is really the way to go with 
> SBCL. I'd like to wait for Waldek's comments on my posts that I sent 
> related to this topic.
> 

I belive that problem we have is theoretically unsolvable:

- Aldor assumes that Sint has at least 32 bit
- Aldor assumes that Sint is the same as SingleInteger
- FriCAS assumes that SingleInter is Lisp fixnum
- sbcl on 32-bit machines has 30 bit fixnums (29 for positive values + sign)

However now I think that Martin way is correct from practial point
of view.  Namely, Lisp declaration just specifies maximal size,
but we can safely use just part of that range.  So we may get
errors when we 32-bit numbers get passed to code expecting
fixnum, but otherwise we should be fine.

Now, Aldor uses 31 bit range for hashes and Boot code must handle
them.  This should pose no problems because relevant Boot code
is mostly untyped.  foam_l has several macros which contain Sint,
we really need 32 bits there.  FriCAS algebra makes little use
of SingleInteger and is careful to avoid crating large numbers
when using SingleInteger.

So I belive that we should not expect many problems from this
mismatch.  In longer run I would like to see such problems fixed,
but in short term the only alternative I see is to say that
the only 32-bit lisp supported by Aldor interface is gcl.  Given
that gcl has many known problems, I think that it is better
to support other Lisps, even if support is not perfect.

To say this differently: due to size mismatch we can not depend
on compiler to guarantee type correctness of code using
Sint and SingleInteger.  However, the problem is to avoid
overflow and type correctness helps only a little here
-- we can only hope that original authors wrote code
carefully, to avoid creating large numbers (well, at default
safty settings sbcl checks that numbers stay in range,
so we will know if something goes wrong).

-- 
                              Waldek Hebisch
[EMAIL PROTECTED] 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to