People discussing the merits of languages based on statistical
popularity should note how many newspapers publish astrology columns.
The language shootouts are not entirely relevant, since the question
here has to do with suitability of a language for implementation of
a computer algebra framework, and for detailed implementation of some
routines.  We seem to agree that Python is not suitable, and
that is why Cython is used instead.  But Python can be used for some
things, and isn't it nice that we can do everything in one language,
except the things that we can't do in that language.

Regarding using GMP or MPIR as the bignum library in Lisp

1.  The occurrence of 11 mpz_adds  in the core of ECL is presumably
the only occurrences EVER, and you could add any amount of additional
code in Lisp and never see another one.  So it is an absolute limit,
not one "relative to the size of the program".  Sage, seems to
sprinkle them around.  And so readably.

2. The built-in arithmetic standard for lisp requires non-destructive
arithmetic in general;  it is possible to use destructive (mutating)
operations within the evaluation of expressions only when the
"destruction" cannot be viewed outside the context of that
expression.
For example, compiling (+ a b c d e f)    could be done with only one
temporary to do  (+e f)    (+ d (+ e f))   , ....
Or a naive compiler might use 5 temporaries,    as (+ a(+ b (+ c (+ d
(+ e f))))).
The generic arithmetic package I wrote is somewhat akin to a compiler
in that it takes an expression like that given above,
figures out how to allocate temporaries and call mpz_ programs.  It is
probably cleverer than the default ECL code generation
using mpz_  code in a purely functional framework.  This is sometimes
an important distinction to make, that a functional
form for communicating computations does not necessarily require a
data flow that is purely functional.  I think I've tried
to make this point a few times in this thread.

3. The allegation of painfully slow operations on huge numbers may
seem like a particularly telling point, but this is probably done
in the absence of any profiling, which is to say:  how much does one
use huge huge numbers?  Thus arithmetic on integers
of 31, 63, or 127 bits may be faster NOT using GMP, and may be umpteen
times more common.   Of course to run a profiler,
one has to have a set of important applications which should be
considered as a benchmark.   Finding Mersenne primes might
be important to some people, whereas to others they are just wastes of
electricity.  The smaller ones are known and it would
probably be pointless to re-examine them.

4.  Bill seems to think that it might even be possible for Maxima to
just do single precision arithmetic.  That doesn't work for
the kind of computer algebra system that most people want.  Any
conforming Common Lisp must provide bignums, and
that's what Maxima uses for integers.

5.  When I said that Lisp could use Python libraries,  I was referring
to the useful libraries written in whatever language, which are called
by Python.
Those libraries can be loaded and invoked by Lisp, and I've used this
once in the past (coincidentally, my first try to find a GMP library
got me gmpy,
and I loaded that into Lisp.)   But calling python from lisp generally
is not hard; see
http://common-lisp.net/project/python-on-lisp/

There is also CLPython, which I think is a Python syntax language that
is implemented in CL.

6. There is a fundamental difference of opinion in language design
between William Stein and the view I hold (and share with many others)
that the best way to write a very large system is to simultaneously
work "top down" on the high level objectives, and "build up" from the
lower language -- to define a new, more suitable, language to achieve
those high-level objectives.  That is, in Lisp, where building
languages upon languages is relatively easy, it seems obvious that one
should cover up, at the earliest opportunity, the
ugliness of the APIs of the utility functions, and wrap them in
functionality suitable for whatever ...  mathematics.   plotting.
parallel execution ...
So William Stein takes it as a point of pride that people use python
syntax and directly access APIs for GMP.  I take it as a weakness
which
leads to error-prone verbose programming.

7. I have no problem with summer-of-code high school or college or ...
students writing programs. Relying on this code as part of the core of
a system is however not such a great plan.

RJF





--~--~---------~--~----~------------~-------~--~----~
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