TopHome
<2024-03-12 Tue>lisptech

Getting Alloy working

UI frameworks in Common Lisp are a mixed bag. Your options narrow down further if you wish to go for a pure CL solution, for nothing more than ideological reasons. McCLIM works, but is a bit janky. It is worth playing around it, but with a look and feel straight out of the 90s, it may be a hard sell. In any case, I am on Wayland now, and McCLIM comes with a single X11 based backend for now.

The other option that stands out is Alloy - a recent development from Shinmera - the solo dev behind the game Kandria. What is remarkable about Kandria is that it is entirely in Common Lisp with the author having created everything needed from scratch. So much effort, the least you can do as a CL user is to consider Alloy for your own work.

So, what does it take to get Alloy running on your system - assuming you have a CL implementation (SBCL in my case) and Quicklisp up and running?

First - Alloy is not available directly on Quicklisp, so you cannot load it by name. Instead, we need to manually put it into the local packages directory. First - find out the path on your setup where quicklisp expects to load local projects from.

In my case:

CL-USER> ql:*local-project-directories*
(#P"/home/chandergovind/.quicklisp/local-projects/")

Now, all we need to do is clone the alloy repo into this folder and we should be done, right? No - the problem is another missing dependency, which luckily is captured in a conversation on IRC here: https://libera.irclog.whitequark.org/commonlisp/2022-03-28 between Shinmera and another user "neominium".

Specifically, you need to:

  1. Clone the following repos into your local projects directory:
  2. There will still be an error due to something broken on msdf side. You need to download an archive from here https://filebox.tymoon.eu//file/TWpRMU9RPT0= and extract into "~/.cache/alloy/msdf/".

With these steps done, you can:

CL-USER> (ql:quickload "alloy-examples")
....
CL-USER> (org.shirakumo.alloy.examples:simple-window)

which should open up a window that should work.

There is your "Hello world, Alloy". Now, the next phase is to go through the examples provided: https://github.com/Shirakumo/alloy/blob/master/examples and try to make sense of this framework.

Happy Hacking!