Package-inferred systems are an ASDF (Common Lisp build system) extension. This extension results from a popular style of Common Lisp programming: spawning one package per file and controlling its imports per file/package. While I don’t necessarily like this style, I have to acknowledge its benefits:
Yet this style of programming might also result in a slew of bad practices. Including difficulty of packaging and undisciplined package pollution. Making package-inferred systems more dangerous than plain systems. Be wary of these.
The way ASDF manual describes package-inferred systems extension is:
Package-inferred systems are pretty useful as they are, parsing packages in a DWIM way.
But they only handle
Each file under the
6.5 The package-inferred-system extension>
This description is already problematic: it suggests
Not using
It might be a misplaced life balance on my side.
But I often spend time idly reading through library sources.
Looking at their algorithmic choices and style.
Maybe there’s even something I can learn:
CL is a big language and I sure don’t know all of it!
I don’t even load the library into the image sometimes.
It might not be comprehensible to me, or the domain would be too alien.
So IDE-less (or, rather, Sly-less) reading it is.
(Just so you understand the depth of my IDE-less madness:
This post is edited in ed(1), the standard text editor.
I’m having an Emacs abstinence month, and I am kinda fine with ed(1) anyway.)
One problem with this IDE-less reading is that symbols don’t have source locations.
This is fine, because I can often
Package-inferred systems promote a style that requires a full-blown Lisp IDE.
One can no longer perceive the library or app statically.
One has to load / build it.
And that puts a huge burden on them, and innocent bystander just wanting to check the style gotchas.
This partially stems from the need to load the system:
packaging package-inferred systems (catch the irony here?) is hell.
I’ve been there, I tried to package Lem for Guix.
Unless one loads the system and interactively queries it for dependencies, they risk missing some dependency when packaging.
And, as a library packager, one is not always a Lisp programmer or, let alone, Lisp professional.
They just want to package the software.
And package-inferred systems make it hard.
Load the system or scour the sources for all the
Package-inferred systems make packaging harder, because they hide and dilute dependency information.
One cannot easily get a full list of deps unless they are proficient in Lisp.
Not all packagers are.
Let packagers do their work.
ASDF is a build system for Lisp, made in Lisp.
No, really, it’s not just written in Lisp, it actually is just a library you load to load other libraries.
In the same REPL.
I sometimes forget what a miracle Lisp world is.
But this easy blend of systems and packages into one symbolic soup is misleading.
Systems are metadata of the library or application as a packaging/build artifact.
Concerning themselves with files and build sequences.
Packages are symbol bags.
Involving code-level resource sharing, reference, and visibility.
These are two different worlds.
Kinda like a work of DevOps is different from a programmer’s one.
One case of system clearly not matching the package is trivial-features.
It doesn’t have a package of its own!
It exports no symbols!
It doesn’t provide any API!
Using it in package-inferred model is simply meaningless, because there’s nothing to use.
Package-inferred systems break an already thin boundary between systems and packages.
Making these ontologically different things tangled up.
I hope this list gives you at least a doubt in package-inferred systems’ usefulness.
Note that I’m not against the one-package-per-file style.
I’m against lack of discipline and transparency in dependency management.
Let’s be kind to each other and not push opaque and dependency-diluted systems on people.
IDE-less Reading
Packaging Hell
Systems are Metadata, not Data
Avoid Package-inferred Systems