LON-CAPA and Maxima



Gerd,

I have been tinkering with a Maxima server mode.
Attached please find maxima-server.lisp which is an initial attempt.
This code executes the conventional Unix server functions --
socket, bind, listen, accept, fork.
It should be much faster to start new sessions this way
(compared to executing maxima ex nihilo), although I didn't
attempt to measure how long it takes to start a new session.

The code is SBCL-specific at present, and it can be executed like this:

load ("maxima-server.lisp");
:lisp (server-run)

With this code running, I find "telnet localhost 1042" in multiple
terminal windows yields multiple independent Maxima sessions.
So far, so good.

I've bumped into various issues that we'll need to resolve.

(1) Lisp errors (e.g. client closes socket unexpectedly) leave
the server in a confused state. Somehow the server must be
protected against all Lisp errors.

(2) The current version of maxima-server.lisp doesn't address
the problem of separating evaluation results from incidental
messages.

(3) The current version of maxima-server.lisp doesn't protect
sessions from using files of the same names. The main problem
I see here is plotting -- the plot functions re-use the same name
instead of generating random temporary names.

(4) The current version of maxima-server.lisp doesn't do anything
to prevent asksign from asking questions (and in fact asksign
doesn't work right because *terminal-io* isn't redirected into the
socket stream).

I think asksign is the biggest stumbling block.
I worked on a scheme to catch asksign queries and turn
them into unevaluated conditionals; maybe now is the time
to pick that up again.

Anyway I hope that this is enough to get the ball rolling.

All the best,
Robert Dodier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: maxima-server.lisp
Type: application/octet-stream
Size: 1806 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20061220/af70a392/attachment.obj