I have the same necessity, I've written a code in Maxima to do
structural analysis with symbolic calculus and it's now almost complete.
I'm starting to write a Qt4 Gui for this, and I was looking to wxMaxima
sources to understand how to communicate with Maxima.
I've also found some documentation on tcl/tk wiki, here:
http://wiki.tcl.tk/12065http://wiki.tcl.tk/12269
I still haven't looked deep inside the code, anyway one should be able
to replicate these functions in another language...
But is there any kind of Maxima official documentation about this?
Maxima wiki has an interesting purpose:
Maxima and programming languages: utilizing Maxima from scripts and
external programs.
It would be really nice and useful to see this section written :-)
Stefano
Robert Dodier ha scritto:
> On Fri, Jan 16, 2009 at 10:20 AM, Alexey Afanasyev <aphongka at yandex.ru> wrote:
>
>
>> I am a newbie in Maxima. I am writing a program in C++ and wish to use
>> Maxima in it. How can I interoperate with Maxima?
>>
>> I have found that one of the possible ways is using sockets. Is this the
>> only way? Is there any documentation on the topic?
>>
>
> Take a look at http://maxima.sourceforge.net/relatedprojects.html --
> in many cases there is a front end written some other language
> which talks to Maxima via a socket. (E.g. XMaxima and wxMaxima.)
> Maybe you can get some ideas from them.
>
> If you are working with sockets you might consider
> share/contrib/maxima-server.lisp
> which implements a simple ordinary Unix server which forks a new
> instance of Maxima for each socket connection. It works only with
> SBCL; should be possible to port it to other Lisps which have fork, etc.
>
> There is also the possibility of linking directly through a so-called
> foreign function interface. Several Lisp varieties have their own, also
> there is one named CFFI which works for several of them (notably,
> excluding GCL).
>
> Maxima was originally written with a pervasive assumption that there
> is always someone at the console. In particular Maxima tries to gather
> user input via the asksign function (which asks questions like
> "Is x positive, negative, or zero?"). Each program which calls Maxima
> has to deal with that in some way. Take a look at the related projects
> page to get some ideas about that.
>
> Hope this helps, & good luck. What kind of a program are you writing?
>
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>