1. I think there is indeed a huge advantage in doing the web server in lisp.
I wrote one for Tilu, which is either online or I can send to you. The
web interface is old and
rather simplistic, and does not deal with "is n positive or negative"
since that
doesn't happen for Tilu. It also just does a simple text display of
formulas, and has
no plotting.
2. I agree with Stavros that you can look at the code; the meat of it
is in that file, in the function "continue".
It is surprising how much embroidery there is to what is, essentially..
(loop (displa(meval(mread)))
I don't know what displayinput does, but just guessing, I would think it
has to do with whether you are doing a batch() input from a file or from
a keyboard. If the input is from a file, do you want to display the
input as well as the output?
Or just quietly chew up the input. And for the web interface, I'm not
sure what you would want to do. You could, perhaps with some benefit,
display the input nicely. You could display balanced parens and
"pretty-print" the command; this might even lead some people to notice
bugs in their input. It certainly does the job for me when I write
programs in lisp.
3. I think that most people using javascript do it because they don't
know lisp. Not that javascript is in any way essential or more convenient.
I am quite sure that you can do it all in lisp.
4. There are still issues like -- if you provide a Maxima server, how do
you provide security? How do you provide for multiple users?
(possible answers: virtual machines; duplicate virtual machines.)
RJF
On 4/8/2011 9:02 AM, Leo Butler wrote:
> I've been hacking at combining Maxima with AllegroServe.
> I have a working version, but I am running into a bit
> of a knowledge shortfall:
>
> Could someone describe to me roughly how the Maxima top-level
> works? I believe that mread -> meval -> displa implements
> the REPL but there seem to be some flags set that I am missing
> because that trio produces output with a superfluous 'displayinput'
> flag.
>
> If it helps, I am running Maxima and AllegroServe in the same lisp
> image, and I am capturing Maxima's input from a get request entity,
> implementing the REPL and firing back the output string. It's
> quite naive, but I can see that we can replace displa with
> a more suitable output parser -- and since meval is spitting out
> structured Maxima forms, turning that into html or whatever
> should be quite feasible.
>
> With a little JavaScript, we could make pretty near any browser
> an interactive front-end to Maxima.
>
>
> Leo
>