Top
Best
New

Posted by gingerBill 6 days ago

A critique of package managers(www.gingerbill.org)
117 points | 216 commentspage 3
Malix_off 5 days ago|
> People abuse cars and ram into crowds, so let's not have cars in our city!

> People abuse knives and stab people, so let's not have knives in our kitchen!

> People abuse package managers and create dependency hells, so let's not have package managers in our programming language!

No matter how you see it, this fits the definition of dumbing down;

Is this what you really want?

If that is the case, then we can shake hands and I will use a different programming language.

gingerBill 5 days ago||
> My general view is that package managers (and not the things I made distinctions about) are probably in general a net-negative for the entire programming landscape, and should be avoided if possible.

I am arguing that their "benefits" are only very short-term, if there is actually benefit for them in the first place. The strawman that you present has been repeated already and is not considering that all of those other things are actually useful and good alternatives.

Malix_off 5 days ago||
The obvious benefit to me are the automations, I have directly experienced these time benefits

I read you think these automations lead to more harm than good so are a net negative, and I understand that point of view

However, I think this is not a tautology

I think dependency hells and bad dependencies absolutely happen indeed, but are conditioned to badly managed programming projects

And I do not want to suffer from the dumbing down of stripping out package managers

gingerBill 5 days ago||
Choose your own hell then. I'm not going to stop you.

And no, it's not a tautology, it's an empirical observation.

And as I said, not everything ought to be automated, especially hell.

j2kun 5 days ago||
If you've ever lived in a place with a localized car ban, it's awesome.
juujian 6 days ago||
I'm very thankful for the Debian team's efforts to include most of my most commonly software packages in their repo. Out of all the differences between me and my colleagues workflows on MacOS and windows, this is the most impactful one. I don't remember the last time I had any kinds of dependency issues. I keep updating my packages when I log on and there are no version and/or dependency issues whatsoever.
Octoth0rpe 6 days ago||
> Each dependency is a potential liability.

I mean, sure. So what does the solution look like? From my perspective it looks like a tool that is able to update your dependencies so that you can easily pick up bug fixes in your dependencies, which sounds an awful lot like a package manager.

> JavaScript is great example of this as there are multiple different package managers for the language (npm being one of the most popular), but because each package manager defines the concept of a package differently, it results in the need for a package manager manager.

This doesn't seem like a strong point to me. Yes, there are things like yarn, pnpm, etc. But IIUC practically all npm alternatives still define packages in the same way (a package.json at the root hosted by npmjs (or your private repo)), and the differences are ergonomic/performance related.

> [that each package manager defines the concept of a package differently] is why I am saying it is evil, as it will send you to hell quicker.

Then I think it's more of a language problem, not a problem with the concept of a package manager.

bluGill 6 days ago||
> t looks like a tool that is able to update your dependencies so that you can easily pick up bug fixes in your dependencies, which sounds an awful lot like a package manager.

If only it where that easy.

Often the update isn't source compatible with the package that uses it so you can't update. There are some projects I use that I can't update because I use 6 different plugins, and each updates to the main project on a different schedule on their own terms - meaning the only version I can use is 10 years out of date and there appears no chance they will all update. (if this was critical I'd update it myself, but there are always more important things to work on so I never will in practice)

Sometimes a package will change license and you need to check the legalese before you update.

Sometimes a package is hijacked (see xv) and so you really should be doing an audit of every update you apply.

Octoth0rpe 6 days ago||
I agree with all of the problems that you're highlighting, but would say that all of those problems exist whether or you're doing manual dependency management or using a package manager.

The solution IMO (which is non-existent afaik) would be to integrate some kind of third party auditing service into package managers. For example, for your npm project you could add something like this to your package.json:

` "requireAuditors": [ { "name": "microsoft-scanning-service", "url": "https://npmscanner.microsoft.com/scanner/", "api_key": "yourkeyhere, default to getting it from .env" } ] `

And when you npm install, the version / hash is posted to all of your required auditor's urls. npm should refuse to install any version that hasn't been audited. You can have multiple auditing services defined, maybe some of them paid/able to scan your own internal packages, etc.

I've thought about building a PoC of this myself a couple of times because it's very much on my mind, but haven't spent any time on it and am not really positioned to advocate for such a service.

wpollock 6 days ago||
The Boost library went the audit route, but AFAIK, few other repositories (or libraries) have done that. I believe it's a cost and lack of manpower that prevents that.

You may not have the time to audit dozens/hundreds of dependencies pulled into your projects, but there's still something you can do. For Rust/Cargo, you can run tools that check every dependency against a vulnerability list. As you have source of dependencies, you can also run static code analyzers/auditors to scan for code smells, lack of unit tests, etc.

For Java, I use the OWASP plug-in of Maven to check dependencies for security vulnerabilities. I bet other languages' package managers/build tools have similar plug-ins.

Some auditing is better than none at all. You shouldn't do no checking just because you can't full auditing!

zdragnar 6 days ago|||
Yeah, yarn and co came about because npm was slow, buggy and didn't honor its own lockfile.

Nowadays it is mostly improved, and the others differentiate by enchantments to workspaces (better monorepo support) or more aggressive caching by playing games with where the installed packages physically exist on the system.

The core functionality- what a package is- has always been the same across the package managers though, because the runtime behavior is defined by node, not the package manager.

gingerBill 6 days ago|||
> So what does the solution look like?

There are no solutions, only trade-offs. And the point is that not everything needs to be, nor ought to be, automated. And package managers are a good point of this.

And yes, a language with an ill-defined concept of a package in the language itself is a problem of the language, but the package managers are not making it any better.

Octoth0rpe 6 days ago||
> And yes, a language with an ill-defined concept of a package in the language itself is a problem of the language, but the package managers are not making it any better.

If a language does not provide a definition of a package but a package manager _does_, then I would say that that package manager did make that aspect of the problem better.

gingerBill 6 days ago|||
It makes it worse in my opinion, not better. Because it leads to the problem that other package managers don't agree on what a package is, and it might even lead to the need for an external build system to co-ordinate all of it too. It's a never-ending problem, and is now even worse.
dismalaf 6 days ago|||
And if the language does provide the definition?
smw 6 days ago|||
"I mean, sure. So what does the solution look like? From my perspective it looks like a tool that is able to update your dependencies so that you can easily pick up bug fixes in your dependencies, which sounds an awful lot like a package manager."

Exactly! Who has the time or the discipline to do that manually?

Sesse__ 6 days ago||
> I mean, sure. So what does the solution look like?

Obviously taking on fewer such liabilities?

Octoth0rpe 6 days ago||
The article specifically excludes this as _the_ solution to the problem:

> I am not advocating to write things from scratch.

and is clear in its target:

> That’s my general criticism: the unnecessary automation.

Yes, fewer dependencies is a solution, but it does not seem to be the author's position.

gingerBill 6 days ago||
That is my position... again, I am not sure how you got this conclusion from the article.

The "I am not advocating to write things from scratch" is more of a caveat to the people I know will comment NIH nonsense rather than anything productive.

But yes, my position is minimize dependencies and slow and carefully vet them too, and do not automate this process.

karmakaze 6 days ago||
The post goes on to say that random packages are not necessarily better than what members of your team could make. At the end it gets to:

> Through manual dependency management. Regardless of the language, it is a very good idea that you know what you are depending on in your project. Copying and vendoring each package manually, and fixing the specific versions down is the most practical approach to keeping a code-base stable, reliable, and maintainable. Automated systems such as generic package managers hide the complexity and complications in a project which are much better not hidden away.

So that makes all of us human package managers. It's also true that you can get a package manager from internet folk that works better than the processes and utilities your team cobbles together to ease the burden.

gingerBill 6 days ago|
Yes. That's the entire point, but it should not be automated which is my point.
bsder 6 days ago||
> SDL3 might fix it all but the time to integrate SDL3 would be the same time I could write it from scratch.

The Programmers’ Credo: we do these things not because they are easy, but because we thought they were going to be easy

gingerBill 6 days ago|
We've effectively written all of this already because of the amount of fixes we've had to do to the SDL2 code. So yes, we know what we are doing.
dboon 6 days ago||
I’ve had major Nissan Altima effect with this lately. A few weeks ago I set out to make a simple C and C++ package manager that just ignores dependency hell in favor of you explicitly specifying packages. And no binaries, just build from source and use Git as a backend for managing what source maps to what builds.

Plus Lua for package recipes. It’s going really well!

coldtea 6 days ago|
>just ignores dependency hell in favor of you explicitly specifying packages

Isn't that basically manual dependency hell?

user____name 5 days ago||
I don't know if this is just coincidental but this was submitted at the same time as a large NPM malware sitution was exposed. https://news.ycombinator.com/item?id=45169657
gingerBill 5 days ago|
Completely coincidental. I wrote the article before the situation, AND the article is a transcription of a video recorded in July.
andriamanitra 6 days ago||
I don't find the argument very convincing. If anything you should have more time to carefully vet your dependencies when you don't need to spend time manually doing the tedious bit. Making things more difficult than they need to be just to introduce friction is a ridiculous proposition.
pluto_modadic 6 days ago||
Package managers are constraint solvers. You could manually figure out if XYZ shared library works with somebody else's code, or, you could expect that they would label the range of shared library versions their code needs.

Note to self... don't use Odin.

mark38848 4 days ago|
Where's the discussion about package sets? Always comparing yourself to Javascript, Java, and friends is obviously easy
More comments...