Moving from Quicklisp to Qlot
When you get into Common Lisp, the first thing you get introduced to is the package manager "quicklisp". All fine
Quicklisp is a great way to get into CL, but I have come the understand the limitations of it and where to go from here quite soon.
What is the problem? Quicklisp manages packages as "distributions" - where the Quicklisp maintainers release a new "distribution" with latest versions of all packages in their listing. Unlike other library management solutions that we are used to, be it pip or npm, this means that all libraries are updated in lockstep after ensuring that they compile together.
This may seem weird, but Common Lisp is a slow moving language after all, so it probably works well. The last release happens to be: June 19, 2023 - which is not too bad for Common Lisp. Check here for a listing of included packages with versions.
What to do if you need a more recent version of a package? Does this even happen?
Yes, it happens, as I just found out first hand with the usocket package. Now, there is a solution you can still use if you want to just keep going ahead with Quicklisp and that is: manually clone the package you need into the local projects dir.
Problem: this version, installed by usocket is too old for my need. I want the latest from the repo.
CL-USER> (ql:where-is-system :usocket) #P"/home/chandergovind/.quicklisp/dists/quicklisp/software/usocket-0.8.6/"
CL-USER> ql:*local-project-directories* (#P"/home/chandergovind/.quicklisp/local-projects/")
$ cd ~/.quicklisp/local-prjects/ $ git clone https://github.com/usocket/usocket
Now, from the CL shell:
CL-USER> (ql:quickload "usocket") ... CL-USER> (ql:where-is-system :usocket) #P"/home/chandergovind/.quicklisp/local-projects/usocket/"
But, can we make this process more controlled and less manual? The answer to this problem is: qlot.
Admittedly, this process adds a lot of extra steps, so I recommend sticking with quicklisp and manual clone as far as you can go.
- Install qlot.
- Init qlot in the project folder and add external packages.
- Ensure that these packages are added into your asdf dependencies as well (it is not enough for the package to be in the qlfile alone…)
- Run
qlot exec sbcl
instead of just sbcl.