This website is generated using some custom code written in Common Lisp (SBCL). The goal was to have a place to host my current and future projects, as well as polishing up my web dev chops.

Implementation

When I originally started building the site, I had a few requirements:

  • Write pages and custom tags using S-expressions
  • Expose the entire lisp language in page and tag definitions
  • Automatic hot reload of static assets

I'm a big fan of the homoiconicity of lisp languages, and I knew that writing the pages in S-expressions would allow me to mix tags and code relatively effortlessly. There's some other benefits as well, such as not having to write closing tags and allowing me to use some neat structural editing tools in Emacs.

I tried finding a good balance between abstraction and ease of use, and after a few unsuccessful attempts I landed on simply using the quote/unquote mechanism of Common Lisp directly. Hopefully, the code will be relatively easy to understand when I get back after a few months to add more stuff.

Hot reloading of the static assets are simply done by watching the assets directory from the lisp runtime and recompile all the pages. I initially had a more fancy tracking of dependencies, but the html generation is fast enough so far that it wasn't worth it (the runtime startup is avoided since the file watchers are hosted inside the lisp process).

  • Language: Common Lisp
  • Platforms:
    • Linux
  • Dependencies:
    • alexandria
  • Dependencies (DEV):
    • clack
    • websocket-driver
    • trivial-file-watch