All things Common Lisp

Content tagged tips

Serve static site with clack in few lines

posted on

While working on this blog I've stumbled on a basic need to serve static website from local folder. Though Coleslaw has magical command coleslaw preview it's good to know how to do it outside of Coleslaw.

There are numerous solutions in any language but we're talking CL here. And it's surprisingly simple:

  1. Install clack with ros install clack
  2. Create app.lisp in the target folder with the following content: (lack.app.file:make-app)
  3. Run clackup -s lack-middleware-static app.lisp and enjoy.
To load "lack-middleware-static":
  Load 1 ASDF system:
    lack-middleware-static
; Loading "lack-middleware-static"

Hunchentoot server is going to start.
Listening on 127.0.0.1:5000.

Minimal Lisp setup using lem

posted on

This is a set of instructions to quickly setup Common Lisp development environment on Linux using Lem editor

  1. Install roswell, see instructions
  2. ros install fukamachi/qlot
  3. ros install fukamachi/cl-project
  4. ros intall cxxxr/lem
  5. Modify .bashrc / .profile to include export PATH="$PATH:$HOME/.roswell/bin"
  6. Create project using make-project following the example provided
  7. Start lem
  8. Open file <project>/qlfile and add dependencies
  9. M-x change-directory to <project>
  10. C-u M-x slime -> type 'qlot/' and Tab to select CL implementation
  11. (ql:quickload :<project>)
  12. PROFIT

Running McCLIM and other Lisp packages on Windows

posted on

McCLIM is an amazing project and a treasure trove of useful utils like CLOUSEAU. Unfortunatelly currently McCLIM has no backend for Windows. I'd like to use McCLIM and experiment with developing a backend.

Windows is quite hostile environment for mostly Unix-based Lisp packages. And McCLIM is not an exception. It uses CLX as a backend library and depends on STATIC-VECTORS - package that require CFFI-GROVELER to dynamically compile C program on system load.