Live data from Hacker News

The fundamental problem of programming language package management

blog.ezyang.com

61–70 of 73 posts

Re: The fundamental problem of programming language package management

#61
post #57

Earlier quoted context omitted.

In Java-land, OSGi was invented to solve this very problem. Every module has its own classloader so module A can load C 1.0 and module B can load C 1.1. Modules are registered and other modules can look them up in the registry and call them so A can look up and then call B without conflicts.

OSGi is good in theory but too much ado for most real-world projects.

Agreed. The Spring support helps a lot though. But there's no question that OSGi is one of the final big xml holdouts in Java-land.

Re: The fundamental problem of programming language package management

#62
Even reducing the problem to one language you run into problems. All serious R developers have run into issues with CRAN (which is mostly centralized) causing problems with different version installs using install.package(). There are mechanisms for dealing with it, but the best solution is usually to maintain your own distribution of packages and a build script: further centralization. And R has a relatively good/simple package management system compared to something like pip, luarocks or Maven. Two which I never had problems with ... maybe because I didn't use them enough: leiningen and go get.

Re: The fundamental problem of programming language package management

#63

Earlier quoted context omitted.

Do you have an automated testing suite? That might explain the difference in experience. I use a lot of automated tests

I don't think its the testing thats work intensive, its fixing things that broke. The more often you upgrade the more often things will break.

Maybe, but s/he did explicitly mention the regression testing taking a long time

Re: The fundamental problem of programming language package management

#64

The situation with packages and dependency hell today is horrendous, particularly if you work in a highly dynamic environment like web development. I want to illustrate this with a detailed example of something I did just the other day, when I set up the structure for a new single page web application. Bear with me, this is leading up to the point at the end of this post. To build the front-end, I wanted to use these…

Sure we can. I imagine first we'll need the ISO to create a project to begin the standardization of software management. Then there'll probably be a few years of research to identify all the kinds of software, platforms they run on, interoperability issues, levels of interdependencies, release methodologies, configuration & deployment models, maintenance cycles, and expected use cases. Then the ISO can create an over…

So now that we know what to do, the big question is: who's going to spend the next 5-10 years of their life on that project?

But this is my point: We are already solving all of those problems, and doing almost all of the work I suggested.

All of the main package managers recognise versions and dependencies in some form. Of course the model might not be perfect, but within the scope of each set of packages, it is demonstrably useful, because many of us are using it every day.

All of the people contributing packages to centralised package repositories for use with npm and gem and pip and friends are already using version control and they are already adding files to their projects to specify the dependencies for the package manager used to install their project — or in many cases, for multiple package managers, so the project can be installed multiple different ways, which is effectively just duplicated effort for no real benefit.

All major operating systems already come with some form of package management, though to me this is the biggest weak point at the moment. There are varying degrees of openness to third parties, and there is essentially no common ground across platforms except where a few related *nix distributions can use the same package format.

All major operating systems also support virtualisation to varying degrees, though again there is plenty of scope for improvement. I’ve suggested before that it would be in the interests of those building operating systems to make this kind of isolation routine for other reasons as well. However, even if full virtual machine level isolation if too heavyweight for convenient use today, usually it suffices to install the contents of packages locally within a given location in the file system and to set up any environment accordingly, and again numerous package managers already do these things in their own ways.

There is no need for multi-year ISO standardisation processes, and there is no need to have everything in the universe work the same way. We’re talking about tools that walk a simple graph structure, download some files, and put them somewhere on a disk, a process I could have done manually for the project I described before in about 10 minutes. A simple, consolidated version of the best tools we have today would already be sufficient to solve many real world problems, and it would provide a much better foundation for solving any harder problems later, and it would be in the interests of just about everyone to move to such a consolidated, standardised model.

Re: The fundamental problem of programming language package management

#65
post #41

Earlier quoted context omitted.

Yes, but something like Idris isn't mainstream. 99% of the languages out there don't allow you to express this kind of invariant.

Certainly, but it's going to become more and more so. The right way to do an API is to expose your invariants. Some day that will be a thing—and the distributed problem will still be here.

That or we will all have to write Javascript in Javascript.

Re: The fundamental problem of programming language package management

#66
post #41

Earlier quoted context omitted.

Yes, but something like Idris isn't mainstream. 99% of the languages out there don't allow you to express this kind of invariant.

Certainly, but it's going to become more and more so. The right way to do an API is to expose your invariants. Some day that will be a thing—and the distributed problem will still be here.

That or we will all have to write Javascript in Javascript :)

Re: The fundamental problem of programming language package management

#67
post #24

> The Git of package management doesn't exist yet We've taken a pretty good shot at this in the OCaml ecosystem the via OPAM package manager ( https://opam.ocaml.org ). * OPAM composes its package universe from a collection of remotes, which can be fetched either via HTTP(S), Git, Hg or Darcs. The resulting package sets are combined locally into one view, but can be separated easily. For instance, getting a view into…

Does OPAM work on Windows? I've read it doesn't which has kept me from further investigations.

OPAM itself compiles on Windows, but most of the package repository doesn't. That's next on our list after the 1.2.0 release comes out (along with cross compilation for targets like iOS, Android and Java, due to the availability of compiler backends for all of these systems now).

Re: The fundamental problem of programming language package management

#68

Earlier quoted context omitted.

Sure we can. I imagine first we'll need the ISO to create a project to begin the standardization of software management. Then there'll probably be a few years of research to identify all the kinds of software, platforms they run on, interoperability issues, levels of interdependencies, release methodologies, configuration & deployment models, maintenance cycles, and expected use cases. Then the ISO can create an over…

So now that we know what to do, the big question is: who's going to spend the next 5-10 years of their life on that project? But this is my point: We are already solving all of those problems, and doing almost all of the work I suggested. All of the main package managers recognise versions and dependencies in some form. Of course the model might not be perfect, but within the scope of each set of packages, it is demo…

The problem you cited before is supposed to be easy, but in practice, software development that uses 3rd-party software is destined to run into conflicts. You found portability issues, platform-dependent issues, environment/configuration issues, and multi-layer software dependency issues.

These all happen regularly when OS maintainers have to package software for release. They spend thousands of hours to resolve [by hand] each one in order to support the various use-cases of their end users. If you are imagining some automated process just magically makes all your software come together to build you a custom development environment, you are mistaken. It's all put together by humans, and only for the use cases that have been necessary so far.

So yes, all these things exist. In small, bespoke, use-case-specific solutions. What you're asking for - universal software management standardization - can't practically be achieved in more than one use case. This is why we are all constantly stuck in dependency hell, until a bug is filed, and the system is once again massaged into a working state by a human. Frustrating, sure. But it works most of the time.

Re: The fundamental problem of programming language package management

#69
post #37

Earlier quoted context omitted.

Inability to install multiple versions of the same package can be a feature. It encourages the creation of stable, backwards-compatible packages.

Sure, it kind of makes sense for managing the software repository of your operating system. But when doing software development, you end up with multiple projects using multiple versions of the same dependency. I mean I tried going the apt-get route back when I was working with Perl - a lot of people in the Perl community like apt-get and there are tools for easily packaging a library into a deb, but it was a pain wo…

> But when doing software development, you end up with multiple projects using multiple versions of the same dependency.

That's what I wish the language designers had avoided. It would be convenient for users if there were never any reasons to want anything but the most recent version.

I know Perl and similar languages tend to value rapid development over complete reliability, but I'd prefer not to think about version numbers or worry about updates that break things. Maybe if the package management systems had been designed with less rope, users would more rarely get hung.

Re: The fundamental problem of programming language package management

#70

Earlier quoted context omitted.

So now that we know what to do, the big question is: who's going to spend the next 5-10 years of their life on that project? But this is my point: We are already solving all of those problems, and doing almost all of the work I suggested. All of the main package managers recognise versions and dependencies in some form. Of course the model might not be perfect, but within the scope of each set of packages, it is demo…

The problem you cited before is supposed to be easy, but in practice, software development that uses 3rd-party software is destined to run into conflicts. You found portability issues, platform-dependent issues, environment/configuration issues, and multi-layer software dependency issues. These all happen regularly when OS maintainers have to package software for release. They spend thousands of hours to resolve [by…

I think it’s a stretch to call a tool like npm, which currently offers 90,000+ packages, a “small, bespoke, use-case-specific” solution. I’m also fairly sure most people publishing their code via npm’s index aren’t spending “thousands of hours” resolving conflicts with other packages by hand; certainly no-one is manually checking over 4 billion pairwise combinations of those packages to make sure they don’t conflict.

And yet npm remains a useful tool, and mostly it does what it should do: download a bunch of files and stick them somewhere on my disk. The same could be said for gem, pip, Bower, and no doubt many other similar tools. They just all do it a bit differently, which leads to a huge amount of duplicated effort for both the writers/maintainers and the users of these packages.

I’m not arguing for magic or for orders of magnitude more work to be done. I’m just arguing for the work that is mostly being done already to be co-ordinated and consolidated through standardisation. To some extent I’m also arguing for operating systems that include robust tools to navigate the modern software landscape as standard, mainly because installing things with tools like apt has an unfortunate way of assuming there should be one global copy of everything, which is frequently not the case for either development libraries or end user software on modern systems, and because if the OS doesn’t provide good universal package management tools then someone else will immediately invent new tools to fill the gaps and now we are back to having overlapping tools and redundancy again.

Post reply on HN