save versus compfile



On 2013-05-02, Wilhelm Haager <wilhelm.haager at htlstp.ac.at> wrote:

> What is the difference between the commands "save" and "compfile" on
> principal? Both produce a Lisp translation of a Maxima function.
> Has one an advantage over the other?

'save' outputs the Lisp expressions which represent the Maxima function,
while 'compfile' outputs a Lisp program which is a translation: a
different program which is supposed to have the same effect.

For example, the Maxima expression a + b is represented by the Lisp
expression ((MPLUS) $A $B) and that is what 'save' outputs. When you
reload the output of 'save', you have the exact same representation
(barring bugs in 'save') as before.

On the other hand, the Maxima-to-Lisp translator will output a Lisp
program which is not necessarily the same as the Maxima program. E.g. if
the translator can prove that a and b are numbers, then it will output
(+ $A $B) which is faster. However, bear in mind that there are probably
bugs in the translator (more so than in other parts of Maxima), so my
advice is to stay away from it. I have fixed some bugs in the translator
but I am pretty sure there are still some remaining.

best

Robert Dodier