[eisseeker] bignums

  • From: "Thomas Baruchel" <baruchel.research@xxxxxxxxxxx>
  • To: "eisseeker" <eisseeker@xxxxxxxxxxxxx>
  • Date: Fri, 24 Oct 2003 18:05:15 +0200

I couldn't manage to repost a message sent to the list by Ralf, because it is 
the first time I have to do the job of moderator. For that reason, I post it 
back from my own address, and I add my answer.

> Thomas wrote 
> > Of course, handling big numbers as strings to be converted by
> > libguile may help for much, but maybe you are thinking to
> > arbitrary precision arithmetic.
> 
> Well, since guile (as I understand) only allows long, you would
> need that where numbers are bigger in the EIS, or do I misunderstand?
> I actually have next-to-nil understanding about interplay of your
> tool with libguile, nor do I have much experience with the Scheme
> language, so please be verbose there.

No, guile, like most Scheme implementations, can use arbitrary length integer 
numbers. As far as only integers are involved, which is the case for many 
tasks, guile can handle it. If it hadn't be the case, I wouldn't have chosen 
guile for my API. I thought it was an interestinglibrary to use, because:
a) as a lisp dialect, sequence of integer numbers is the most natural object to 
handle from a Scheme function;
b) guile is intended to be an extension language; thus, new functions can be 
defined (from the C source code or from a user's configuration file), but the 
whole base of the Scheme standard is already accessible, with all its power. It 
the user already has his own Scheme functions, he will be able to access them 
as usual.

For the use of my tool, the main way is to use it for accessing at a high level
the database, each sequence being read being applyied to a Scheme lambda 
expression. For instance, after having said to the software where is the 
database, you can do:

(eis-for-each (lambda (n) (begin (display n) (newline))))

which will display each sequence on the screen, 'n' being replaced by the 
sequence, but
less trivial things can be done, with the help of other functions, that can 
discard
sequences, map them into another sequences before applying a function to them,
rebuild a "pseudo-database" by transforming and discarding sequences, etc.

> > I know that deeper things may need a bignum library.
> 
> Not deeper. The EIS itself is bignum.
Well, I said "deeper", because eisseeker already handles all the sequences, 
thanks to the power of guile. I thought that you were asking about "deeper" 
things, like arbitrary precision for real numbers, which guile can not handle.

> 
> > I have no preference; pari may be a good idea, since it offers more
> > that only bignums (many interesting functions that gmp does not know...). I
> > have not thought much about it yet, and have no idea. What do you think of 
> > it?
> 
> let's agree on Pari, for now.

One of the next things I will do will be to interface the "parsers" with pari, 
in
order to convert a sequence to a pari vector.

--
Thomas Baruchel
Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34?/mn) ; tél : 08 92 68 13 50 (0,34?/mn)



Other related posts:

  • » [eisseeker] bignums