I asked this question about PNPM architecture internals a while back, PNPM is the latest rendition of a Node.js package manager which solves a lot of the pain points of Yarn and NPM, but has to hack around some requirements of the node_nodules folder that Node.js itself uses. Learning from the pros/cons of both Yarn and NPM, which learned a lot themselves from Rubygems, which goes back and back to other legacy languages, etc., PNPM seems to include the latest best practices for building a package manager.

But I'm wondering, can the architecture of PNPM be simplified a bit if you are building a programming language from scratch? Like, do you need all the fancy symlink and nesting behavior of the internals, or can you get by without that (in a robust system)? Obviously you want to have a lockfile of some sort as well, so some things one would just copy over to a new programming language. But some other things seem like they are unnecessary, I am just not well versed enough to determine fully yet what can be omitted if building a package manager for a brand new programming language.

See the links to PNPM internals documentation I linked to at the top of the post, to see some of the motivations behind PNPM.

  • The design of package manager will be heavily dependent on the language itself. In particular how importing works, and whether it is compiled or not.
    – freakish
    Commented May 28 at 4:09
  • Dependency management is generally nothing to do with programming languages (A language is merely a set of syntax and grammar rules), and more to do with runtime environments. Package managers solve issues left open by the runtime host environment, particularly its filesystem, ensuring the right version can be located at build time and runtime, etc. This is one of the reasons docker containers are so popular, why many ecosystems use 'virtual' runtime environments, isolated away from the host, and why C and C++ are probably never going to find a good solution to package management. Commented May 31 at 8:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.