wow, I post one place and it comes out in two places...

Here is an amplification about the comments on GMP and GMPY.

>From the perspective of Sage and python, I just took a look at the
current gmpy.
The documentation,  which has not apparently been updated since 2003,
says

"Early tests have shown that supporting Python 2's "in-place
operation" functionality (by making MPZ, MPF and MPQ Python objects
mutable) would offer a substantial performance boost.

Despite this, widespread feeling among Python cognoscenti appears to
be against exposing such "mutable numbers". .... "

................

So my comment about the unsophisticated python wrappers for gmpy are
still correct for now, at least if the documentation is up to date.


If that is true, Sage, using this gmpy, imposes a significant
limitation to persons attempting
to use gmp in its most efficient manner, using mutable numbers.

Some lisps that use gmp directly, may also avoid the parts that do
mutation, since that causes problems with the functional model that
prevails with the simplest viewpoint of lisp arithmetic.  That does
NOT mean that lisp cannot use GMP and mutation.

For examples of how I used gmp from Allegro Common Lisp,  a lisp that
does not natively use GMP, see
http://www.cs.berkeley.edu/~fateman/generic
and especially...
http://www.cs.berkeley.edu/~fateman/generic/gmp.lisp

I initially tried loading the python-packaged gmp library into lisp --
it worked fine, but was limited. So I load the gmp library directly.


There are also comments in that file that give comparisons for
different hardware and different versions of gmp.
If you use the "generic pentium" gmp instead of the specific version
for pentium3 or pentium4 [depending on what
you are using!] then you suffer a penalty of 3X in speed.  Or did so
when I ran those tests.

I don't know if Sage is set up to provide linkages to the "most
appropriate" GMP for each architecture, but
there are substantial efficiency differences.

To the extent that you find it acceptable to set up the foreign-
function interface, probably anything you can
import into python, you can import into lisp, though not uniformly for
all lisp implementations.  And the
foreign-function interface is somewhat diddly, which is why there are
some utilities that will read a *.h file and generate
most of it automatically.  I didn't use one myself, since I used only
a few entry points to start, and added
only those that I thought I needed.






--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to