[Aldor-l] [fricas-devel] Re: aldor fricas interoperability... call for testers

Ralf Hemmecke ralf at hemmecke.de
Fri Aug 8 07:30:39 EDT 2008


>>> Index: src/interp/foam_l.lisp
>>> ===================================================================
>>> --- src/interp/foam_l.lisp      (revision 336)
>>> +++ src/interp/foam_l.lisp      (working copy)
>>> @@ -50,7 +50,7 @@
>>>   compile-as-file cases
>>>  
>>>   |Clos| |Char| |Bool| |Byte| |HInt| |SInt| |BInt| |SFlo| |DFlo| |Ptr| 
>>> - |Word| |Arb| |Env| |Level| |Arr| |Record|
>>> + |Word| |Arb| |Env| |Level| |Arr| |Record| |Nil|
>>>  
>>>   |ClosInit| |CharInit| |BoolInit| |ByteInit| |HIntInit| |SIntInit| 
>>>   |BIntInit| |SFloInit| |DFloInit| |PtrInit| |WordInit| |ArbInit| |EnvInit|
>> This rest is not justified whether it doesn't break anything else.
>>
>>> @@ -157,7 +157,7 @@
>>>  (deftype |Bool| () '(member t nil))
>>>  (deftype |Byte| () 'unsigned-byte)
>>>  (deftype |HInt| () '(integer #.(- (expt 2 15)) #.(1- (expt 2 15))))
>>> -(deftype |SInt| () 'fixnum)
>>> +(deftype |SInt| () '(integer #.(- (expt 2 31)) #.(1- (expt 2 31))))
> 
> This one is to account for the fact that sbcl fixnums are only 29 bits, but
> Aldor SInt's use 32 bit.  Of course that may buy us trouble elsewhere, but
> otherwise the aldor interface will not work at all.

OK. But I simply guess that "Aldor SInt's use 32 bit" is not true.
Show me
1) the specification of SInt for Aldor that says this.
2) the place in the compiler code that implements this specification.

Anyone with knowledge should help Martin out here.

Next question, how would fixnum (except being just 29bits) behave 
differently? Would it faster (for example in SBCL) than

(deftype |SInt| () '(integer #.(- (expt 2 29)) #.(1- (expt 2 29))))
                                           ^^                 ^^
i.e. 29bit integer definitions?

I must say, if in Axiom appears anything that blindly assumes that SInt 
is 32 or at least 31 bits, must be considered as a bug. I doubt that 
there is a clear specification for Axiom's SInt. Or is there?

Another thing is, if I grep the fricas sources, I only find |SInt| in

src/interp/axext_l.lisp
src/interp/sys-pkg.lisp
src/interp/foam_l.lisp
src/interp/interp-proclaims.lisp

So I believe the modification you suggest above should work at least for 
32 bit machines. Simply since Axiom does not know SInt, only foam knows.

I guess that for 64 bit machines you should have something else. My 
understanding always was that SingleInteger (or MachineInteger in 
libaldor) should hold a machine word.

So I would be much more happy if the patch is somehow coordinated with 
the foam definitions in the Aldor compiler and thus perhaps be 
conditional depending on the bit size of the machine.

Ralf




More information about the Aldor-l mailing list