Subject: [clisp-list] Foreign functions, or, How can I write web server code with CLISP?

From: Matt Curtin <[email-masked]>
Date: 13 Jan 2001 21:07:41 -0500

Might there be any documentation or example code for using CLISP's
interface to foreign objects?  I'm contemplating talking to the Apache
API.  (I also want to know for other reasons -- I'm also interested in
talking to libpcap...)

I'd really like to be able to find a way to write Apache servlets in
Common Lisp.  There has to be a way to do this without a lot of pain
and suffering being involved:
 o I don't want to port some behemoth like CL-HTTP to CLISP so I can
   write web code (CL-HTTP doesn't seem to work with CMUCL 18c);
 o Apache seems to be doing a good job of tying programs and whatnot
   to the web, so I say, let it manage that job;
 o Because CLISP is able to write such small images, it seems like
   it's in a good position to compete, resource-wise, with less
   optimal languages that have a reputation of producing small and
   fast runtime code.
 o I tried to get the onShore IMHO stuff running, using Apache JServ
   and its connection to CMUCL, which rapidly got way out of control.

Just for giggles, a few minutes ago, I did a completely unscientific
experiment to test the relative level of load for Perl/CGI code as
compared to essentially the same thing using CLISP.  In a trivial
"Hello, Web" Perl program, I was able to drive the load up to about
.35 on my Indy just by continuously banging on the program for about
30 seconds.

I did the same thing with a "Hello, Web" program written in Common
Lisp, compiled, and dumped to a memory image, then wrapped with some
Bourne shell that would invoke clisp quietly, without loading startup
stuff, and using the image I dumped.  Banging away on the server, I
was able to get the load up to about .25.

Of course, this isn't highly important, since I really don't want to
write CGI code, but having just cranked out some CGI Perl to get a
small job done quickly, I'm beginning to wonder if maybe the "cost of
entry" for writing web server-side code in Lisp is just too high...

-- 
Matt Curtin, Founder   Interhack Corporation   http://www.interhack.net/
"Building the Internet, Securely."   research | development | consulting