[Paper Review] Package Managers à la Carte: A Formal Model of Dependency Resolution
The paper introduces the Package Calculus, a minimal formal system that unifies dependency resolution across diverse package managers and provides extensions to model real-world differences, enabling cross-ecosystem translation and resolution.
Package managers are legion. Every programming language and operating system has its own solution, each with subtly different semantics for dependency resolution. This fragmentation prevents multilingual projects from expressing precise dependencies across language ecosystems; it leaves external system and hardware dependencies implicit and unversioned; it obscures security vulnerabilities that lie in the full dependency graph. We present the extit{Package Calculus}, a formalism for dependency resolution that unifies the core semantics of diverse package managers. Through a series of formal reductions, we show how this core is expressive enough to model the diversity that real-world package managers employ in their dependency expression languages. By using the Package Calculus as the intermediate representation of dependencies, we enable translation between distinct package managers and resolution across ecosystems.
Motivation & Objective
- Identify common core concepts across over thirty package managers.
- Develop the Package Calculus to capture dependency resolution, deployment, and root constraints.
- Show how extensions model real-world axes of variation (conflicts, concurrent versions, peers, features, etc.).
- Demonstrate translations between package managers using the calculus as an intermediate representation.
Proposed method
- Define the core calculus with packages, dependencies, resolutions, and the three core conditions (root inclusion, dependency closure, version uniqueness).
- Prove NP-completeness of Dependency Resolution and discuss methods to avoid it in practice.
- Extend the core calculus to model axes of variation (conflicts, concurrent versions, peer dependencies, features, package formulae, variable formulae, virtual packages).
- Show reductions from each extension back to the core calculus for soundness and completeness.
- Present reductions that collapse cross-ecosystem translation from n^2 translators to 2n translators using the calculus as an intermediate representation.

Experimental results
Research questions
- RQ1How can dependency resolution across diverse package managers be captured in a single formal model?
- RQ2Can extensions for real-world features (conflicts, concurrency, peers, features, etc.) be soundly reduced to a core calculus?
- RQ3What is the complexity of dependency resolution in real-world settings, and how can it be mitigated?
- RQ4Can cross-ecosystem translation be achieved efficiently using the Package Calculus as an intermediate representation?
Key findings
- The Package Calculus provides a minimal formal system that captures root inclusion, dependency closure, and version uniqueness.
- Resolution is NP-complete in general, but restricted forms and extensions can avoid or manage this complexity.
- Each axis of variation (conflicts, concurrent versions, peer dependencies, features, package formulae, variable formulae, virtual packages) can be modeled as an extension with a sound and complete reduction to the core.
- Cross-ecosystem translation is reduced from n^2 translators to 2n translators by using the calculus as an intermediate representation for dependency expressions.
- Go, Cargo, Nix, opam, and other ecosystems illustrate different strategies along the spectrum from strict version constraints to exact-name-version dependencies, influencing resolver complexity.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.