How to use Maxima from within C++ program (CGI)?



On 8/7/07, Yigal Asnis <yigalasnis at yahoo.com> wrote:

> How can I use Maxima from within C++?
>
> By the way, two more general questions:
> 1. May be there is better platform for using open
> source math software like Maxima, SAGE, Pari, Yacas in
> web site? May be PHP or Perl or other option?
> 2. Where can I get more information about building web
> site for interactive math with open source software?

I think there have been several projects to run Maxima as a
back end for CGI output. Take a look at
http://maxima.sourceforge.net/relatedprojects.shtml
from which you might get some ideas.
I think SAGE in particular could be a good source of ideas.

I suspect it's going to be easier to use a language with
built-in regular expression functions. This might suggest
Perl or Python. But Lisp would be a good choice because
then you can call Maxima functions directly from your
CGI program. Just replace the top-level processing loop
with something that reads CGI inputs instead of the console.

The main problem with using Maxima as a computation engine
is that Maxima asks questions sometimes (because it assumes
there is always someone at the console). This problem has been
handled in different ways by different projects. I don't know
what is the best solution at present.

You might find share/contrib/maxima-server.lisp useful.
It calls fork to launch Maxima sessions, so it is faster to
start a new session than executing Maxima just once.
maxima-server.lisp only works with SBCL.

HTH
Robert Dodier