This is a read-only archive!

Partial Lisp successes

I got my Common Lisp photo blog largely working today. It's nothing special, but it displays thumbnails and photos along with meta-data for them, and it allows navigation to different pages. And it stores objects persistently in a mysql database. I feel like that's an accomplishment given the amount of pain I went through even to get that far. Just getting hunchentoot to serve up static JPG files was a chore I hope not to repeat now that I know how to do it. (p.s.: hunchentoot:handle-static-file) Some features it's still lacking are 1) letting people make comments, 2) anti-spam measures for the comments, 3) letting me post new pictures. Thought it's straightforward enough to do via the REPL, do I really need an HTML form? Probably not.

It's only about 250 lines of code (including all the HTML (or rather the Lisp that generates the HTML) and database schemas), but it could be far shorter and nicer if I knew what I was doing. I've enjoyed playing with Lisp even when it was driving me mad.

I'm not putting the site online yet though, until I have time to take care of such small matters as preventing everyone on the world from connecting and using my REPL, and keeping the server online for more than a few minutes at a time. I know there are ways to keep a Lisp image running and connect to it via SLIME, but I want to read more about it. I also have no clue whether hunchentoot is multi-threaded already or if I need to set something up to handle HTTP requests in parallel or what. I know SBCL supports threading to some degree but I'm unsure how it all works.

And I need to find an Emacs color theme that displays parens in a faded color so they don't stand out so much. I saw a nice one somewhere on someone's blog with a dark background and darkish grey parens but I've since lost it.

January 12, 2008 @ 6:14 PM PST
Cateogory: Programming
Tags: Lisp, Emacs

3 Comments

Ivar Refsdal
Quoth Ivar Refsdal on January 13, 2008 @ 9:07 PM PST

I do believe you can ssh tunnel your swank server (REPL) to some local machine if you like.

Ivar Refsdal
Quoth Ivar Refsdal on January 13, 2008 @ 9:08 PM PST

Just delete the comment above. Hrm.

I do believe you can ssh tunnel your swank server (REPL) to some local machine if you like.

This video shows you how to do it: http://common-lisp.net/movies/slime.mov

Brian
Quoth Brian on January 14, 2008 @ 5:04 PM PST

I learned quite a few tricks from that video. Thanks for sharing.