Eran Gat, if I remember correctly, had an implementation of lexically scoped packages. That would provide the capability for having multiple versions of the same system live in one lisp image, but would require rewriting the systems in question and their consumers.
TBH, this seems to me like a pretty esoteric use case: I'm curious about how and when you encounter it.
If you're interested in cool language features, that's one thing, but I can't imagine as an engineering matter that you couldn't hack around the few times this would happen.
Note that there's a less demanding item -- having ASDF be able to manage a set of libraries with multiple versions, without being able to load different versions of one library into a single lisp image. This might occur more frequently -- e.g. I could imagine systems that are bug-compatible with different versions of CFFI.
Cheers
On Apr 28, 2016, at 19:05, Ian Tegebo ian.tegebo@gmail.com wrote:
I've been reading the manual, papers, and slides on ASDF and XCVB. As a frame of reference, I prefer the qualities exhibited by Racket's implementation of modules. I was disappointed both to see XCVB bitrot, and then to see that a major ASDF overhaul would be necessary.
That said, ignoring Racket/ASDF/XCVB, I'm curious about how loading multiple versions of the same system could possibly be implemented in Common Lisp (CL). I'm sure people have thought about it, but I'm having a hard time finding references. I'm afraid I've been skimming some of the material linked off of the ASDF and XCVB pages, so forgive me if I missed something.
On the JVM, there's the notion of "classloader" that can be used to load multiple versions of the same class. Unfortunately, the only approach I can imagine is to use some form of package renaming. There appear to be several variations floating around [1], and the trade-offs aren't clear to me.
If I think about how it might be done in ASDF, it seems like it would require a series of things:
- intercept package definition to rename with version
- :around-compile to handle some kind of per-system aliasing so code doesn't have to change
- teaching dependency resolution how to find the renamed, versioned packages/systems
But that's a wild guess. And the more I think about it, I wonder what to do about some code that uses strings to put together a symbol - I don't think symbol-macrolet can help there.
[1] implementation-specific package-local-nicknames, :around-compile in ASDF, "pseudonyms"
-- Ian Tegebo