Tutorial :Common Lisp: What's the best way to use libraries in a shared hosting environment?


I was thinking about this the other day and wanted to see what the SO community had to say about the subject.

As it stands right now Common Lisp is getting some attention as a web development platform, and with good reason (of which I'm sure you are already convinced).

I was wondering how one would go about using a library in a shared environment in a similar fashion to PHP.

If I set up something like SBCL as an interperter to interpret FASL files like Python or PHP, what would be the best way to use libraries (like clsql for instance).

Most come as asdf installable libraries, but it would be a stupid amount of overhead to require and install the library each and every time a request is made.

Keeping in mind this is for shared hosting; would it be best to ..

1) Install system wide copies of the libraries for use in applications; reduces space, but there may be problems with using the correct version of the library.

2) Allow users (through a control panel) to install local copies for themselves; more space, no version problems.

3) Tell them to wrap it into a module and load it on demand like Python does (I'm not sure if/how this can be done with Lisp). Just being able to load a library for use would be the best option, but I don't think a lot of them are designed to be used this way.

Anyways, looking to hear your opinions, thanks.


There are two ways I would look at it:

  1. start a Lisp for each request

    This way it would be much better that the Lisp is a saved image with all necessary libraries and data loaded. But that approach does not look very promising to me.

  2. run a Lisp and let a frontend (web browser, another web server, ...) connect to it

    This way you can either start a saved image or a Lisp that loads a bunch of stuff once and serves the requests.

I like to use saved images/applications in a deployment scenario. They can be quickly started, contain all the necessary software and are independent of library changes.

So it might be useful to provide pre-configured Lisp images that contain the necessary software or let the user configure and save an image.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »