Log in

No account? Create an account

mod_lisp is not like mod_otherlanguages

What's mod_otherlanguage like?

  • mod_perl: "...gives you a persistent Perl interpreter embedded in your web server."
  • mod_python: "...is an Apache module that embeds the Python interpreter within the server."
  • mod_tcl: "...includes a Tcl interpreter into an Apache web servers memory space, thus combining Tcl and Apache web server together."
  • ruby, PHP, Lua, Haskell, etc: all similar

mod_lisp isn't like that at all. It doesn't embed a Lisp system in Apache in any way. So what does it do?

mod_lisp is more like FastCGI. It's a small C module for Apache that handles a request by converting it to a simple text format, sending it over a socket to a Lisp system, and sending the Lisp system's response to the client. The socket is established on demand and can be kept alive for multiple requests.

If all you have is mod_lisp, you still need software to process the mod_lisp protocol and send a response. mod_lisp doesn't come bundled with any Lisp code to do that. There are several Lisp packages that make it easy, though. I use an old variation of Hunchentoot. Bill Clementson surveyed the Lisp web options a few years ago and mentions a few other options.

mod_lisp is not even really Lisp-specific; if you can multiplex network connections and parse simple text, you can write something in any language that works with mod_lisp. It's pretty likely that your language already has an Apache module or an interface to FastCGI, though, unless it's even more obscure than Lisp.




I wonder why the original author didn't simply use FastCGI?

There is, I believe, a known issue with some FastCGI client implementations not liking talking to a multi-threaded FastCGI server; they prefer single thread, multiple OS process. Might be something to do with that...

Re: FastCGI

The fastcgi protocol looks much more complicated than mod_lisp. It's not hard for me to imagine that it would be easier to write mod_lisp from scratch than write an interface to FastCGI.