haskell / haskell/hackage-server

Contextual (time-dependent) mapping of package names to packages; garbage collection

Open
#985 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
467
Forks
225
PR merge metrics
No merged PRs in 30d

Description

As it stands, if I upload a package `X` then the package name `X` will forever point to my package (and its revisions). If I abandon my package and let it die, still the name `X` will be taken forever.
Mathematically, there is no problem with this, since at each point of time the available names is a potential infinity. However, people like "nice" names that make their package easily discoverable, and those nice names should not be taken up forever by dead packages.

In fact, we need not eternally bind a name to a fixed package. (In natural language, words are not bound to the same meaning for all eternity, but the meaning can change over time as human culture develops and objects disappear from every-day life and new objects appear.)
Resolution of names to packages could be time-dependent. At each point in time, there is a _context_ that maps package names to packages. If a package is uploaded at time _t_, then context _t_ is used to resolve the names it mentions. Even if at a later time a name is assigned to a new package, the references of older packages stay intact.
This way we could open the avenue to future garbage collection of dead packages, making their names available for new packages (after some resting time).
One could even refer to package whose name has been reassigned by explicitly providing the context, e.g. `X@2013` could point to the package that held the name `X` in 2013. In general, the absolute reference would be `X@t` where `t` is a point in time, given to the precision where no ambiguity arises in the resolution of `X`. But usually, the context can be implicit; there would be no need to change the user interaction in any way.

I think we would not need to store extra information. All the information to reconstruct the context at a certain point in time is already on hackage (i.e. the upload times for the packages).

If it were decided recycle a name, an entry like `unlink X` could be added to the hackage journal to indicate that the name can be taken again (after some resting time of a couple of years).

Original write-up: https://github.com/haskell/hackage-server/issues/112#issuecomment-950147006

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.