guile-devel
[Top][All Lists]
Advanced

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

Re: Guile uses GNU MP


From: Dirk Herrmann
Subject: Re: Guile uses GNU MP
Date: Wed, 20 Sep 2000 17:02:02 +0200 (MEST)

On Tue, 19 Sep 2000, Joerg Kreienbuehl wrote:

> I have changed numbers.(c|h) so that it uses the GNU MP (GMP).  [...]

While I have not looked at your code, I think the move to gmp is the right
decision for guile.  Thus, I'd like to say thank you very much for the
work that you have put into this.

>   - The calls to GMP-Functions should be #ifdefed and configure must
>     provide a HAVE_GMP flag.  The code could probably changed, so that some
>     key functions return doubles instead of bignums, so that most of the
>     other functions don't have tho bother about HAVE_GMP
>   - Probably I can simplify some functions that check for every possible
>     combination  of types.

It may be better, before you go ahead to do any fine tuning, to take a
look into goops, since the upcoming integration of goops into guile's core
will make this a lot simpler and allow for a much cleaner handling of
generic functions.

For example, goops will determine the parameter types of a call to a
generic function (like, for example `+') and then automagically invoke the
function that is suited for those types, say `scm_add_comlex_real'.  Then,
the whole type dispatch stuff that currently obfuscates numbers.[ch] can
be removed.  Thus, your suggested simplification of type checks would not
be necessary, or would potentially have to be done differently.

Further, due to its treatment of the type space, goops would allow to put
the whole bignum support into a separate module, and this would eliminate
the need to encapsulate the bignum code within #ifdef HAVE_GMP blocks.

> As I am not a autoconfig/automake guru, probably someone could make the
> nessecary changes for GMP.  And if someone has a testfile to test
> arithmetics, just send it to me!

Guile already comes with a testsuite, which currently does not perform
very exhaustive checks, but which might form a good starting point.

BTW:  Please note that the location of the guile lists has changed.

Thanks a lot again,
Dirk Herrmann



reply via email to

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