Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

October 2006
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Sep  Nov

Hunchentoot - The CL web server formerly known as TBNL

Friday, October 13, 2006

Edi Weitz writes a lot of nicely-written and documented CL libraries and I always enjoy using his code. So, I was recently intrigued to read that he was planning to port his Hunchentoot web server to multiple CL implementations (his implementation of choice is normally LispWorks although his libraries usually work on a variety of different CL implementations) and replace his TBNL web server with it. He indicated: "I'm thinking about re-organizing/purifying the TBNL code-base. It looks pretty messy to me now and I think I could get rid of a couple of things if I find the time.". Well, in the space of a month, he's made excellent progress and Hunchentoot is looking quite promising. I recently decided to download it and give it a try.

First of all, there are a number of dependent libraries that need to be installed. Since CLiki is currently down (it's in the process of being moved over to the Tech Coop servers), I used Marc Battyani's Common Lisp Directory to locate the latest versions of each dependent library. In addition to the libraries that Edi lists, there are a number of additional libraries that are needed (dependencies of the dependencies, so to speak). Also, if you want to run his examples, you'll need his CL-WHO library. So, in the end, I downloaded the following:

I decided to use OpenMCL as my CL implementation for testing Hunchentoot (I often use OpenMCL if I'm testing things locally on my Powerbook as it's a nice open source CL implementation for the Mac). I kicked off the build as per the instructions using ASDF but soon hit a CL+SSL/CFFI error as it couldn't find libssl.so on my Mac. I remembered seeing mention of this problem on the mailing list, so I patched the cl+ssl.asd file as suggested:
(defparameter *libssl-pathname*
   #+(or :win32 :mswindows) "libssl32.dll"
   #+(and :openmcl :darwinppc-target) "/usr/lib/libssl.dylib"
   #-(or :win32 :mswindows :darwinppc-target) "/usr/lib/libssl.so")
With that minor fix, everything built without any problems!

After building, it was simply a matter of running the example to test things out. Hunchentoot definitely looks nice and I'll have to experiment with it a bit more in the future!

emacs Copyright © 2006 by Bill Clementson