Live data from Hacker News

Ask HN: Why does every package+module system become a Rube Goldberg machine?

news.ycombinator.com

101–110 of 222 posts

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#101
It's because the software ITSELF is structured poorly, not just the package managers

Big pyramids of dependencies are inherently fragile (whether dynamically or statically typed)

Dependency inversion can make it so that your dependency tree is exactly 1 deep, and it's dynamically wired together in main()

But most people don't write code in that style. It takes extra effort

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#103
post #45
post #31

> In contrast, we apparently have no "package management theory". We have not figured out the primitives required to express dependencies We have a good hunch. The basic theory behind Nix definitely goes in the right direction, and if we look away from all the surface-level nonsense going on in Nix, it's conceptually capable (e.g. [0]) of being a first-class language dependency manager. For this to work at scale we'd…

2) In Debian a binary package has almost always just been a cache, are we thinking about Debian packaging in completely different ways? Are you perhaps talking about the aspect of doing an "build world"[0] that bsd, Gentoo and now Nix are better at? [0] Edit: rebuilding your dependencies if you need it and handling that seemlesly CAN be hard on Debian. Something that even Nix struggles with even if they are best in c…

Debian packages can have pre/postinstall scripts that mutate the overall state of the system in arbitrary ways. This is both (a) necessary to make some thing work and (b) ruins the theoretical model.

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#104
post #31

> In contrast, we apparently have no "package management theory". We have not figured out the primitives required to express dependencies We have a good hunch. The basic theory behind Nix definitely goes in the right direction, and if we look away from all the surface-level nonsense going on in Nix, it's conceptually capable (e.g. [0]) of being a first-class language dependency manager. For this to work at scale we'd…

If the community just focused on creating a great package manager instead of an Everything Monster, and “meeting developers where they are”, then Nix might do something great.

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#105
post #6

Have you used Go or Rust package ecosystems? My experience is that the older gen languages you mention had to invent package management, made lots of understandable mistakes and now are in a backwards compat hellscape. Rust and Go built their packaging story with the benefit of lessons learned from those other systems, and in my experience the difference is night and day.

Go package management is a mess of hacks. It doesn't even have a repository, instead relying on source control systems to do the actual work, with special hacks for each source control system to define the artifacts that can be downloaded (e.g. using Git tags with some magic format, or Perforce commit Metadata). It requires you to physically move all code to a new folder in your version control if you want to increas…

Some of your criticism is reasonable, and I’m no fan of Go’s module system as a standalone artifact, but much of your criticism is unfounded.

> It requires you to physically move all code to a new folder in your version control if you want to increase the major version number.

This is untrue.

> It requires users of your code to update all of their import statements throughout their code whenever you move your hosting.

This is only true if not using a vanity URL, but is sadly often the case.

> It takes arcane magic to support multiple Go modules in the same repo.

I don’t know what you’re calling arcane magic here, but we maintain repos at work with 6-7 go modules in without it being an issue whatsoever, and no “arcane magic” required, so I’m going to go ahead and say this is untrue too.

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#106
post #31

> In contrast, we apparently have no "package management theory". We have not figured out the primitives required to express dependencies We have a good hunch. The basic theory behind Nix definitely goes in the right direction, and if we look away from all the surface-level nonsense going on in Nix, it's conceptually capable (e.g. [0]) of being a first-class language dependency manager. For this to work at scale we'd…

I think 3 is probably true for language developers, but for users, language repos feel like they are needed because like none of the linux distros really ship everything you need, or even a reliable fraction without installing a bunch of dumb hacks to get it to work. It's much easier just to do "pip install" so that's where the demand is.

And sure, may be you're right that distro packaging is the "wrong model," again, that is the problem then for distros, users are stuck using ubuntu or whatever so they don't have the option to do the "right" thing, so they do use the mishmash of packaging/repo systems as just the cost of doing business.

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#107
post #64
post #50

Earlier quoted context omitted.

Package management in Go is weird but it works well. You just run go mod tidy from time to time and you're good. Add a module proxy if you want to prevent issues with repositories disappearing and you're gooder.

There's already a module proxy (pkg.go.dev) by default in new versions of Go, for just that purpose. In fact, one could argue that the automatic proxy is "Rube-Goldberg"-like: It works great normally, but if you need, for instance, to pull from a repo you just pushed to, you have to track down the magic rune to type to get `go get -u` to pull directly from your repo, rather than using the cached copy at pkg.go.dev.

In go, if you just pushed to a repo a tagged version, say "v1.4.2", then you just specify "go get -u "myrepo.com/foo@v1.4.2". Internally it will fail to fetch from the moduel proxy, but then (by default) it will then look directly for the git repo, and it will still work. But you can also use go workspaces if you are co-developing modules in different repositories.

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#108
post #31

> In contrast, we apparently have no "package management theory". We have not figured out the primitives required to express dependencies We have a good hunch. The basic theory behind Nix definitely goes in the right direction, and if we look away from all the surface-level nonsense going on in Nix, it's conceptually capable (e.g. [0]) of being a first-class language dependency manager. For this to work at scale we'd…

I think 3 is probably true for language developers, but for users, language repos feel like they are needed because like none of the linux distros really ship everything you need, or even a reliable fraction without installing a bunch of dumb hacks to get it to work. It's much easier just to do "pip install" so that's where the demand is. And sure, may be you're right that distro packaging is the "wrong model," again…

Apart from not shipping what you need, you often only get a fraction of the versions you need.

For development you may want to test your code against multiple versions of the system libraries. This is not easy using a distro package manager.

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#109
post #6

Have you used Go or Rust package ecosystems? My experience is that the older gen languages you mention had to invent package management, made lots of understandable mistakes and now are in a backwards compat hellscape. Rust and Go built their packaging story with the benefit of lessons learned from those other systems, and in my experience the difference is night and day.

Go and Rust don't have packages. They have tooling to pull library code from git and build it in-place to be linked into a local project. That's not (really) packaging.

Cargo does not “pull library code from git” unless you expressly ask for it to.

And given that packages have to depend on other packages, and cannot depend on a git repository, that feature is mostly useful for testing bug fixes, private repos for leaf packages, stuff like that.

Re: Ask HN: Why does every package+module system become a Rube Goldberg machine?

#110
post #6

Have you used Go or Rust package ecosystems? My experience is that the older gen languages you mention had to invent package management, made lots of understandable mistakes and now are in a backwards compat hellscape. Rust and Go built their packaging story with the benefit of lessons learned from those other systems, and in my experience the difference is night and day.

Go package management is a mess of hacks. It doesn't even have a repository, instead relying on source control systems to do the actual work, with special hacks for each source control system to define the artifacts that can be downloaded (e.g. using Git tags with some magic format, or Perforce commit Metadata). It requires you to physically move all code to a new folder in your version control if you want to increas…

> It requires you to physically move all code to a new folder in your version control if you want to increase the major version number

That's simply not true. That's only one way you can do it. Another way is to create a branch.

Post reply on HN