Writing Mathematica programs in Macsyma .. was Re: [Maxima] "Delayed" problem in mfunction/mmacro definition
Subject: Writing Mathematica programs in Macsyma .. was Re: [Maxima] "Delayed" problem in mfunction/mmacro definition
From: Richard Fateman
Date: Fri, 19 Nov 2004 10:09:22 -0800
Here's the scoop.
1. If you have a Mathematica program written using only the
simplest kind of features, e.g. ordinary Fortran-like assignment
statements, then you can probably just take them and put them
into Macsyma/Maxima by changing some [] to (), and inserting * some places.
2. If you try to do this automatically, without looking at
the code, you are unlikely to succeed. You will have to touch it up
in some places.
3. Some features have different names and different semantics. For
example, simplification or expansion flags. Numbers are different.
Some features are missing from one or the other. So you will have to
touch it up in some places.
4. Since the automatic translation may have bugs, it is not going to
work perfectly,
and you are going to have to learn how to touch it up in some places.
Conclusion:
Without knowing exactly how sophisticated or large your Mathematica
code really is, we can't say for sure how much effort is warranted to
do the translation automatically. But building the automatic translator
is NOT going to do the whole job. Considering that it will not bypass
the need for careful examination and correction and testing, maybe you
should
just convert your program using some tool like ... emacs?
Unless your objective is to write a translator. (The meta problem
rather than the problem. The typical computer science approach is...
why write a program to do X when I can write a program to write that
program? )
RJF
Siver Andrey wrote:
>----- Original Message -----
>From: "C Y" <smustudent1 at yahoo>
>To: "Siver Andrey" <siver@sirius.ihep.su>; "Maxima-List"
><maxima@math.utexas.edu>
>Sent: Thursday, November 18, 2004 11:07 PM
>Subject: Re: [Maxima] "Delayed" problem in mfunction/mmacro definition
>
>
>
>
>>--- Siver Andrey <siver@sirius.ihep.su> wrote:
>>
>>
>>>My task is to try to make something like Mathematica-machine as
>>>MAXIMA package. "parser.lisp" of MockMMa contains functions (such
>>>as 'p') which translate Mathematica notation of the expressions
>>>into Lisp notation:
>>>
>>>(%i1) :lisp(load "e:/siver/mma1.6/parser-1.lisp")
>>>T
>>>(%i1) :lisp(p)
>>>f[x_]=x
>>>=>(SET (F (PATTERN X (BLANK))) X)
>>>
>>>So, problem is to interpret the list in term of MAXIMA objects.
>>>
>>>
>>Which might or might not act enough the similar ones in Mathematica to
>>arrive at the intended answer.
>>
>>
>
>That's why somelike Mathematica-machine is needed :).
>
>
>
>>I think parser.lisp + Maxima function
>>mapping is likely to be primarily useful as a sort of "first cut"
>>translation tool.
>>
>>
>
>I think one can define binding-functions (in lisp environment) (such as SET)
>and then just call the EVAL function.
>
>
>
>>I applaude what you are trying to do, but are you
>>trying to do it for purposes of rewriting packages in Maxima or to try
>>and run Mathematica notebooks directly? (Sorry if I missed an email
>>explaining this.)
>>
>>
>
>I have some Mathematica modules (.m files) which I would like to run without
>use of Mathematica (they use a little number of functions (and some of them
>were actually transtaled from fortran automatically)).
>
>
>
>>Eventually (post 6.0 or later) I would like to see about translating
>>Feyncalc into a Maxima package, so tools like this would be VERY useful
>>:-).
>>
>>
>
>Feyncalc is not simple package. I'm not sure that those binding-functions
>which cover all my needs will be enough to run Feyncalc under MAXIMA.
>
>
>
>>CY
>>