[Maxima] How to use Maxima from within C++ program (CGI)?
fateman at cs.berkeley.edu
Thu Aug 9 10:14:58 CDT 2007
Lisp libraries are available for producing dynamic web pages.
I used lisp exclusively in Tilu (unfortunately now on hiatus: the server is
The idea that you would write another parser for maxima (of course using a
parser tool), is still a waste of your time, and likely to produce only a
partial solution. You could go further and in your C++ program write a lisp
"reader" and a garbage collector and ....
> -----Original Message-----
> From: Yigal Asnis [mailto:yigalasnis at yahoo.com]
> Sent: Thursday, August 09, 2007 3:10 AM
> To: Maxima at math.utexas.edu; Richard Fateman
> Subject: Re: [Maxima] How to use Maxima from within C++ program (CGI)?
> GiNaC library have a parser so I can easy transform
> strings to expressions and vice versa in C++.
> The question about Lisp is wether is possible to make
> CGI with it? In C++ I have cgicc library that is doing
> all the dirty work.
> Yigal Asnis
> --- Richard Fateman <fateman at EECS.Berkeley.EDU> wrote:
> > The main issue in my view is that the C++ program is
> > going to send/receive strings of characters.
> > If the strings of characters are just numeric, then
> > you are not using maxima very much.
> > If the strings of characters are symbolic names,
> > operations, etc, then you are either doing trivial
> > things with them,
> > like printing them, or you are writing, in C++, a
> > parser. Which suggests that you should just be
> > writing in Lisp.
> > If you are just printing stuff, e.g. into html, then
> > you could learn how to do so from lisp, and be done
> > with it.
> > The advantages you get from making a C++ interface
> > are
> > (1) you know C++ and don't know Lisp.
> > (2) you have some old programs you want to use in
> > C++.
> > The better solution is to (a) learn lisp and (b) use
> > the old C++ programs by calling THEM FROM LISP.
> > I anticipate these suggestions will fall on deaf
> > ears, but I figure it is worth stating, every so
> > often.
> > RJF
> > ----- Original Message -----
> > From: Robert Dodier <robert.dodier at gmail.com>
> > Date: Tuesday, August 7, 2007 6:14 pm
> > Subject: Re: [Maxima] 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
> > > _______________________________________________
> > > Maxima mailing list
> > > Maxima at math.utexas.edu
> > > http://www.math.utexas.edu/mailman/listinfo/maxima
> > >
> Choose the right car based on your needs. Check out Yahoo!
> Autos new Car Finder tool.
More information about the Maxima