Maple or Mathematica to maxima conversion



My goal here is not to implement maple, but to convert contributed code,
usable by anyone to
maxima.  I expect the tool to convert the code syntacticly, and by
converting some of the
function calls to maxima ones, most of the semantics.  The most difficult
problem in
conversion is the idioms used in the language, ie: sequences which I am
mapping to lists,
which creates a lot of garbage.  I expect that after the code is
processed, a human still has
to understand the code to produce efficient maxima code.

Richard Fateman wrote:

> While some parts of the translation are simple, it is not
> clear how to handle different scope rules and function call
> disciplines.  Maple has a kind of phoney way of returning
> multiple values by setting certain trailing parameters as
> call by reference  (or maybe even call by name).
>
> Also binding certain values affect global behavior. Like
> precision.
>
> Here's another approach, which is NOT easy, but I have
> thought about some.
> I believe that a parser for Maple could be done by using
> a parser generator and the Maple syntax (assuming it is
> LALR(1)).  This plus the lexical analysis should take about
> 10 pages of code.
>
> And then implement the Maple kernel in Lisp. It should
> only take 50-100 pages of code.
>
> Then you can take any program written in the Maple
> language and run it in Lisp.  You can also make
> judicious substitutions in the pseudo kernel of
> Maple, e.g. change the way arithmetic is done, or
> simplification, etc.
>
> Difficulties:  finding out EXACTLY what the Maple kernel
> does is not easy.  (But there is no way around it if
> you are going to run Maple programs, regardless of the
> syntax... either you implement kernel in Maxima-ese or
> Lisp).
> Using all that "intermediate" Maple code that belongs to
> Maplesoft.
>
> That is, if some contributed "free" code is written to
> use some visible but copyrighted Maplesoft Maple-code, one
> does not have the rights to use it.  (e.g. the Maple integration
> program can be examined by any Maple owner.  It can't legally
> be moved to Maxima though.  At least I don't think so.)
>
> For what it is worth, the same technique could be used for
> imitating Mathematica except that the language is not LALR(1);
> fortunately I wrote a parser that does this.
>
> Writing a Mathematica kernel in lisp is more work, since it
> is larger than Maple's kernel, very diffusely scattered, and
> fairly secret.  You can, to a limited extent, defeat some
> of Mathematica's security by removing the "Protected" attribute
> from a function, and then list stuff.  For example, I
> got  from ??CosIntegral
>
> its definition in terms of ExpIntegral, and other junk as well
>
> dan.stanger@ieee.org wrote:
>
> > I am currently working on converting Dr. Thomasset's program which
> > converts maple to mupad to produce maxima code.  I have quite a bit
> > of the syntax done, the semantics is more difficult.
> > Dan Stanger
> > _______________________________________________
> > Maxima mailing list
> > Maxima@www.math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima
> >
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima