Accessing maxima programmatically from R



Hello Soren,

> I come from the statistics community where I am involved in the R-project
> (www.R-project.org). There has been some discussion within the R-project
> about getting computer algebra available in R. My question is therefore it
> it is possible to access maxima programmatically from another program??

The short answer is yes. 

One method which has been used to implement an interface with another
program (typically a graphical user interface or web interface) is to open
a socket to send commands (unparsed) to Maxima and read results.
I made some comments about this recently:
http://www.math.utexas.edu/pipermail/maxima/2005/010547.html

However, with R it seems a tighter connection should be possible,
since (if I am not mistaken) internal R data structures are not too
different from Lisp lists (and Maxima is implemented in Lisp).
It seems possible that R could send parsed expressions to be 
evaluated, instead of unparsed strings. 

Here is an article about Maxima expressions; perhaps after
perusing this you could say to what degree the low-level 
representation of expressions is compatible with R:
http://maxima.sf.net/wiki/index.php/Maxima%20internals

I know R can call C and Fortran functions; is it possible to call 
Lisp functions as well? If so, that would obviate the need for a
socket connection (whether the medium of exchange be 
strings or expressions).

Hope this helps,
Robert Dodier