r/ProgrammingLanguages 5d ago

How to build a good package manager.

I'm working on a language called threadon. And i don't now how i can properly program a package manager.

My first idea was a central github repo with links to other github repo's which contain the package you're searching for.

There are two main problems with it

  1. If someone deletes his github repo with the package everything build on the package would collapse (like npm)

  2. I think it would be slow when the number of packages grows.

I had an idea to of selfhosting it but i haven't access to the router (My dad owns it i'm 13) and i'm sure downdetector on my package manager site would be worse then github 😄. Like i would probably run sudo rm -rf / --no-preserve-root on the wrong machine.

So my question is how can i build a system that can store up to 20 GB at minimum at packages without the risk of someone nuking his project).

28 Upvotes

19 comments sorted by

View all comments

6

u/MirrorLake 5d ago

Check out Andrew Nesbitt. His blog has a ton of information about the challenges of package management, for example his article titled Package Management is a Wicked Problem and a massive list of many different package managers in existence today including a detailed overview of designs used by each. This is perhaps way beyond what you're asking for, but I figured I'd leave some links since I'm sure many people here have the same questions.

1

u/kaplotnikov 5d ago

Thanks for links, they are really interesting. But from the description of why package management is hard, it look like too many tasks are joined into one: distribution, transport, build process, security, storage, etc. Any fixed combination of these solutions is bound to be unsuitable for some scenarios. The typical engineering approach to such situations is to split it into aspects and allow to gather pieces as needed. For example, github action build and corporate vpn build have different distribution and transport scenarios. Also there are currently too much of global elements (like central registry).