[GiNaC-list] sympy, Maxima, GiNaC, and others (lament of a physicist)

Ondrej Certik ondrej at certik.cz
Thu Jan 3 15:14:28 CET 2008


On Jan 1, 2008 6:04 PM, Alexei Sheplyakov <varg at theor.jinr.ru> wrote:
> Hello!
>
> On Tue, Jan 01, 2008 at 02:24:33PM +0100, Ondrej Certik wrote:
> >
> > I was recently at a Sage workshop, some of my notes here:
> >
> > http://ondrejcertik.blogspot.com/2007/11/sage-days-6.html
>
> I've got some comments regarding SymPy and sage, I post them here
> (as 'Post a Comment' function on that page does not seem to work
> properly). I hope this is not off topic on the GiNaC list.
>
> > SAGE wraps Maxima, because Maxima is quite fast, very well tested, so it
> > works well.
>
> Although the algorithms implemented in Maxima are quite good, Maxima is
> dog slow and unreasonably memory-hungry. That stems from awful memory
> management facilities of the underlying LISP system (GCL). Unfortunately,
> Maxima maintainers ignore these issues. So people who need to get their
> calculations done were forced to write their own tools (GiNaC being one
> of them).
>
> > It's difficult to extend
>
> That's not quite true. Maxima is just a custom LISP system (roughly, a LISP
> library), so it is possible to extend it either with LISP, or (via foreign
> function interface) with virtually any programming lagnuage.
>
> > and written in LISP and that's very bad.
>
> Actually, that's very GOOD. One can concentrate on the problem being solved
> instead of learning (the lastest version of) some programming language which
> happens to be popular today.
>
> > it's in Python,
>
> Life is to short to learn every (ill-designed) programming language
> out of there. Especially if existing programming languages (LISP/FORTRAN/C)
> cover every task in a CAS (and not only CAS) programming. It's very sad that
> people keep reinventing the wheel (or rather, rewriting it in their pet
> programming languages) instead of improving existing tools.
>
> > but currently slower than Maxima
>
> Ouch!
>
> > rewriting parts of SymPy using Cython, or even C directly,
>
> So, you've reimplemented GiNaC in Python, and now reimplementing that in C?
> This sounds like reinventing the wheel, doesn't it?  And what's the point
> of that (leaving aside having fun :)?

Fun is an important part. But the main reason is to have fast CAS in
python. I am
one of the authors of swiginac (so that we use the wheel, instead of
reinventing it), but that's not the way.
As to speed, we are improving. As shown here for example:

http://groups.google.com/group/sympycore/browse_thread/thread/8062076c7bc8807d

we now have a prototype of a code, that is pure Python, but 2.5x to 5x
faster than Maxima.
And on some tests around 4x slower, thatn swiginac. Then rewriting
some parts to C, we should
(at least we believe) get comparable speeds as swiginac.

Ondrej


More information about the GiNaC-list mailing list