2

I come to Lisp from the Python world, which essentially runs on virtualenv and pip as the way to create containers and manage dependencies.

Currently, I am learning Common Lisp in more detail and wondering what its community's philosophy is on managing dependencies and packages.

For instance, if I run:

(ql:quickload '(cl-who hunchentoot parenscript elephant fiveam css-lite cl-json))

it is my understanding that all these packages will be installed somewhere within the quicklisp directory. (I am not sure in which form or where they are installed).

The question is whether sometime it is necessary to install a different version of a package, depending on the code at hand. That is, what does one do in that case? Does he simply rely on the backward compatibility of the package?

How does the Common Lisp world deal with this?

MadPhysicist
  • 5,401
  • 11
  • 42
  • 107
  • 1
    Possible duplicate of [How do I manage common lisp dependencies?](https://stackoverflow.com/questions/19718002/how-do-i-manage-common-lisp-dependencies) – Barmar Oct 13 '17 at 23:53
  • Possible duplicate of https://stackoverflow.com/questions/46609034/common-lisp-package-and-module-management – Ehvince Oct 14 '17 at 10:07
  • 1
    Note: I gave you two links in your other question that answer this. See the discussion on the Quicklist issue and Qlot. – Ehvince Oct 14 '17 at 10:12
  • 1
    Quicklisp installs its packages into `~/quicklisp/dists/quicklisp/software/`. – Ehvince Oct 14 '17 at 10:28

1 Answers1

5

If you need a specific version of a package for development, you just have to clone it into a repository automatically found by Quicklisp (~/quicklisp/local-projects/). This version will be available for all projects. If you need this to be project-local, or to easily ship a list of dependencies with an application, you can use Qlot, which is really like a pip requirements file and a venv.

There's also Quicklisp bundles as pointed in this other answer.

Even more, there's Quicklisp controller to build dists, a whole set of packages that work together, just as does Quicklisp, but for your own related set of packages. That's what cl21 does for instance.

I'd advise not to bother with those yet until you know you need it ;)

Ehvince
  • 17,274
  • 7
  • 58
  • 79
  • Thanks, mate. I am just trying to gather an idea of how things are done in Lisp world. Is it fair to say that packages are mostly backward-compatible since Common Lisp is a much more stable language than Python? – MadPhysicist Oct 14 '17 at 16:42
  • 1
    Indeed it seems so but the language doesn't seem the only reason. Quicklisp builds all packages together. It seems that library maintainers care a lot about backward compatibility. Lately I learned about an SBCL feature being removed after 15 years of deprecation warnings. Now I wonder how things can be with a new library evolving quickly. Seems like authors release a new library instead of a breaking new version (Caveman and Caveman2, Prove and Rove,…) – Ehvince Oct 14 '17 at 20:15
  • now my feeling :) (it's been a few months I'm exploring the CL ecosystem) At first it seems weird, but it's very easy and thus a joy to work with QL packages. No more manual pinning of dependencies and thus regular related errors. To work with a library in development mode: no `pip install -e .` but a simple clone in the right directory. Now, Qlot errored out when I tried it… – Ehvince Oct 14 '17 at 20:41
  • I added a word about Quicklisp Controller in my answer. – Ehvince Oct 14 '17 at 20:43