[Aldor-l] [fricas-devel] Re: aldor fricas interoperability... call for testers
Martin Rubey
martin.rubey at univie.ac.at
Fri Aug 8 07:54:54 EDT 2008
Ralf Hemmecke <ralf at hemmecke.de> writes:
> >>> -(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.
I don't have the specification, BUT: hashes produced by the Aldor compiler are
typed as SInt's and do not fit into 29 bit. They do fit into 32, however.
> 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?
Maybe, I don't know. The main difference, though, is that a fixnum in sbcl
cannot hold an integer greater than 2^29-1.
> 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?
No, it's aldor that assumes 32 bits for SInts, I believe.
> 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.
Oh, this is very good news! So, it's actually sufficient to check that Aldor
does not convert axiom's "SingleInteger"s into "SInt"s, which is unlikely, I
guess.
Great!
> 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.
I'm guessing that the Aldor compiler currently just uses 32 bits. I have no
idea at all where foam SInts are actually used in Foam.
Martin
More information about the Aldor-l
mailing list