Making Maxima be Mathematica compatible...



In my experience it makes more sense
to call your C programs from lisp, because
lisp takes care of memory allocation and
other things its own way.  Calling into lisp
from C in the same object file is possible
but not so attractive.

If your C programs
offer no special advantage over just
using Maxima (always a possibility...)
you could chalk your efforts up to a
learning experience and proceed to
use lisp etc. for your next project.

Or if you want to proceed further with C
using Maxima...
Another possibility is for you to produce
character strings that look like macsyma
commands and receive and re-parse character
strings of the same nature, from a different
process. maybe a pipe, or via files.

Another possibility is to use lisp-like strings
instead. Then the parsing both ways is
trivial.

Other people may have other suggestions.
RJF


seberino@spawar.navy.mil wrote:
> Richard
> 
> Thanks for the email.  I'm really impressed with
> the work you've done and am excited to chat
> with you about it.
> 
> OK, let me give you the background you asked
> for then I'll ask questions after...
> 
> I have a Ph.D. in physics and almost all my work
> for over 10 years has involved computational
> physics aka scientific computing.  I have a passion
> for doing numerical work elegantly and accurately.
> 
> I've used Mathematica for as long as I can remember
> for various projects and love it.
> 
> I am only interested in computer algebra systems
> that are Mathematica compatible even if just for
> a subset of Mathematica.
> 
> I've been writing a little C toy Mathematica just
> for fun.
> 
> I want this little C toy program use call Maxima
> somehow for Integrate[..] and D[..] (Mathematica
> functions for integration and differentiation)
> and perhaps other things.
> 
> My program will parse user input strings into
> expression data structures.
> 
> Are there any docs somewhere to help someone
> in doing this??? I thought of two
> ways to do this and don't know if they are the best
> ways or how hard:
> 
> 1. Make Maxima object file I can like with C code
>    just like people do with Fortran object files.
> 
> 2. Run Maxima in a separate thread and communicate
>    with pipes.
> 
> Performance and efficiency will be concerns
> obviously too.
> 
> Sincerely,
> 
> Chris
> 
> 
> 
> 
> On Sat, Dec 07, 2002 at 08:15:59AM -0800, Richard Fateman wrote:
> 
>>
>>seberino@spawar.navy.mil wrote:
>>
>>>I see threads on list about people converting
>>>Mathematica code to Maxima code with scripts
>>>and such...
>>>
>>>Any talk/interest in making Maxima be
>>>able to speak Mathematica rather than
>>>having  different syntax/style to learn?
>>
>>There is a free Lisp-language Mathematica parser
>>(MockMMA) that I wrote.  It includes a rudimentary
>>evaluator and pattern matcher. It is roughly
>>Mathematica 2.0 equivalent syntactically.
>>
>>But to make something really work like Mathematica,
>>one would have to reverse-engineer hundreds of thousands
>>of lines of code.
>>
>>Perhaps you could be more specific as to what
>>you wish to do.  If all you need to do is to have
>>Maxima allow you to write Sin[x] instead of sin(x),
>>that is easy.  If you want to write Plot3D[...]
>>into Maxima and get the same exact results as Mathematica,
>>that is not easy.
>>
>>RJF
>>
>>
>>>Chris
>>
>