[Maxima] Mathematica compatibility functions
pdl at johnlapeyre.com
Sun Sep 14 16:21:00 CDT 2008
Hmm. I see in the Maxima manual that there are a half dozen
functions that could be Mathematica function names, the
rest begin with a lower case letter. What a pity!
> I would propose using a longer, explicit prefix, e.g. mma_XXX. This is
> clear and explicit. It generalizes well (maple_XXX, matlab_XXX, etc.). It
> is consistent.
Yes, a rule that will generalize and be easy to apply would be
good. If the identifiers are legal in Maxima, then maple_XXX, mma_XXX, with
XXX exactly as it appears in the other language is a good choice.
Of course a packge system that allows selectively importing symbols would
be better ...
> Of course, the biggest challenge in all this is not naming the functions,
> but having them be functionally equivalent in all cases, including messy or
> undocumented edge cases.
I am trying to get access to Mma. For now I am translating
more or less every example from the function
descriptions. There is some overlap with the goal of testing
all cases, but its not perfect (eg, the docs do say what
Fold does with an empty list). And, whenever, I fix an
implementation error, I add a test. And I reimplemented some
recursive routines iteratively and added tests that would
fail in a recursive implementation (and put them in a
separate file because they take a long time) Making our own
test cases rather than taking them from published
documentation is probably less dubious legally.
For many functions, its relativley easy to get the
functionality thats used (I guess) 80 or 90 percent of the
time and a lot more work to get the rest. So I did the easier
part and moved on. In the test file, I try to add a test for
the extended behavior that is commented out with a
note. This way a user can check what it implemented.
I want to get enough functonality to translate a test project,
but usually its not hard to add a lot more than the minimum.
100% compatibility is a goal, but currently the combination of
breadth and depth first is dictated by my perceived need.
> Also, the user needs to be aware that Mathematica
> and Maxima performance may be vastly different in some cases where
> different representations or algorithms are used.
Yes, and the implementation may not mimic the original algorithm.
I am not going for premature optimization. So the performance can
be expected to be worse than native Maxima (lisp or Maxima).
More information about the Maxima