Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia.
Subject: Maxima Lapack is very slow: 7 seconds versus 0.002 seconds in Julia.
From: Richard Fateman
Date: Sat, 05 May 2012 18:12:24 -0700
It seems to me that there are about 2.5 plausible choices for numerical
code for
Maxima.
1. Write the code in Lisp, properly declared, and run it through a high
quality
compiler. It should be possible to generate good code. (Otherwise one
would have to argue that Lisp, the language, is inherently unsuited to
expressing
numerical computation, by which I mean loops, array references, and
arithmetic.)
2. Use the existing code, or write additional code, in whatever language
is deemed
to be the best host for numerical code by virtue of excellent compilers
(etc.)
That would probably be FORTRAN, but possibly C. Link to the code, or to the
library using some foreign-function interface. To do this nicely for
Maxima it
may be necessary to devote attention to programming that would benefit
just one Lisp implementation family, or maybe even just one machine
architecture.
2.5 Translate code (e.g. from FORTRAN) into Lisp, converting to choice 1.
There are a number of implausible choices. e.g.
3. Rewrite Maxima in some other existing language (e.g. C, C++, Python,
Java...)
4. Introduce yet another language that is "just as fast/compact/....
as" some existing
language, and write Maxima in that.
This is not to say that Common Lisp is the ideal language for implementing
Maxima, but any other language proposal would have to be so much better
than Common Lisp as to convince people to change.
Note that Macsyma/Maxima was NOT written in Common Lisp, but in a
dialect called Maclisp, implemented on the DEC PDP-6 and PDP-10
computers, on GE 645 (Multics), and DEC VAX ("Franz Lisp"). It
was converted to Symbolics Lisp-machine Lisp, and eventually to
Common Lisp.
It is likely that the source code could be converted to (say) Python
or Java or Julia
by some automated process, but this would be unlikely to make it run faster
or make it easier to comprehend.
My opinions, anyway
RJF