TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The fundamental problem of programming language package management

134 点作者 route66超过 10 年前

14 条评论

chrisfarms超过 10 年前
Nix, NixOS, Nix ... a thousand times Nix.<p>I can&#x27;t believe the article doesn&#x27;t mention it.<p>I&#x27;ve been using NixOS as my OS for development, desktop and we&#x27;re in the middle of transitioning to using it for production deployments too.<p>Nix (the package manager not the distribution) solves so many of the discussed problems. And NixOS (the linux distribution) ties it all together so cleanly.<p>I keep my own fork of the Nixpkgs repository (which includes everything required to build the entire OS and every package), this is like having your own personal linux distribution with the but with the simplest possible way of merging changes or contributing from upstream.<p>I use it like I&#x27;d use virtualenv. I use it like I&#x27;d use chef. I use it like I&#x27;d use apt. I use it like I&#x27;d use Docker.<p><a href="http://www.nixos.org" rel="nofollow">http:&#x2F;&#x2F;www.nixos.org</a>
评论 #8226529 未加载
评论 #8227546 未加载
评论 #8227783 未加载
评论 #8226683 未加载
akavel超过 10 年前
This topic reminded me of some very interesting thoughts from Joe Armstrong, that I remember seeing posted somewhere (HN?) some time ago -- &quot;Why do we need modules at all?&quot;:<p><pre><code> [...] The basic idea is - do away with modules - all functions have unique distinct names - all functions have (lots of) meta data - all functions go into a global (searchable) Key-value database - we need letrec - contribution to open source can be as simple as contributing a single function - there are no &quot;open source projects&quot; - only &quot;the open source Key-Value database of all functions&quot; - Content is peer reviewed These are discussed in no particular order below: [...] </code></pre> Full thread: <a href="http://thread.gmane.org/gmane.comp.lang.erlang.general/53472" rel="nofollow">http:&#x2F;&#x2F;thread.gmane.org&#x2F;gmane.comp.lang.erlang.general&#x2F;53472</a>
评论 #8228272 未加载
评论 #8227232 未加载
评论 #8228085 未加载
评论 #8227810 未加载
评论 #8227590 未加载
评论 #8227014 未加载
danielweber超过 10 年前
When I sit around and think &quot;what&#x27;s the biggest improvement I could make personally to the computing world?&quot; there&#x27;s always this voice in my head saying &quot;kidnap whoever is building the next package management system and lock them in a deep dark box.&quot;<p>There seems this fundamental disconnect between people <i>making</i> languages about how people <i>use</i> their languages. I don&#x27;t have time to follow your Twitter feed, because I&#x27;m working on a lot of different things. I know it&#x27;s important <i>to you</i>, the Language Developer, and so you think it should be important <i>to me</i>, the Language User. But I have dozens of things to keep track of, and all of them imagine that they&#x27;re the most important thing in my world.<p>It&#x27;s like the old office culture mocked in &quot;Office Space&quot; where the guy has 7 different bosses, each imagining their own kingdom is the most important.
peterwwillis超过 10 年前
Completely misses the real fundamental problem: people make assumptions about their target. Almost all of this discussion is centered around Linux systems. What about Windows? What about Solaris? HPUX? AIX? VMS? Tru64? Plan9? BeOS? Android?<p>Package management itself is not a solved problem, so you can&#x27;t very well expect programming languages to be any different. The existing systems work quite well and make total sense: your package manager is tailored to your specific use case. Centralized&#x2F;decentralized is a red herring. First figure out how to package every single thing for every single system and use case in the world, and then come back to me about organizational systems.
评论 #8228295 未加载
calpaterson超过 10 年前
The downside he mentions to &quot;pinned versions&quot; actually applies to everything on this page. If you don&#x27;t pay attention to security updates, you will be vulnerable whether or you forgot about your pinned versions or you forgot about your stable distribution.<p>&quot;Stable&quot; distributions have an additional downside he doesn&#x27;t mention: when you upgrade every package all at once it&#x27;s a LOT more effort than if you had upgraded them slowly over time. Dealing with multiple library changes at once is an order of magnitude more difficult than dealing with them one-at-a-time.<p>And also, to some extent, if all the libraries you are using have a long term stable API, then it doesn&#x27;t actually matter which one you pick - anything is painless.
评论 #8226656 未加载
评论 #8226961 未加载
davidgerard超过 10 年前
Every program with plugins of any sort will eventually include a sketchy rewrite of apt-get. Not just languages - WordPress, MediaWiki ...<p>If you&#x27;re <i>very</i> lucky, the packaging in question will not conflict horribly with apt or yum. So you probably won&#x27;t be lucky.
评论 #8226621 未加载
shadowmint超过 10 年前
yeah yeah, I read the previous post (<a href="http://www.standalone-sysadmin.com/blog/2014/03/just-what-we-need-another-package-manager/" rel="nofollow">http:&#x2F;&#x2F;www.standalone-sysadmin.com&#x2F;blog&#x2F;2014&#x2F;03&#x2F;just-what-we...</a>) too.<p>Maybe this time we can talk about how to meaningfully solve these problems instead of just fighting pointlessly about if old tools are so great should be used for everything.<p>Decentralized package management huh?<p>How would that work?<p>A way of specifying an ABI for a packages instead of a version number? A way to bundle all your dependencies into a local package to depend on and push changes from that dependency tree automatically to builds off of it, but only manually update the dependency list?<p>I&#x27;m all for it. Someone go build one.
评论 #8226686 未加载
评论 #8226598 未加载
pkolaczk超过 10 年前
Just by reading the title I expected this would be about fixing the dependency diamond problem. I.e. when library A needs library C 1.0 and B needs library C 1.1 incompatible with C 1.0 and then libraries A and B meet in the same project :(
评论 #8228475 未加载
评论 #8227178 未加载
scottlocklin超过 10 年前
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&#x2F;simple package management system compared to something like pip, luarocks or Maven. Two which I never had problems with ... maybe because I didn&#x27;t use them enough: leiningen and go get.
avsm超过 10 年前
&gt; The Git of package management doesn&#x27;t exist yet<p>We&#x27;ve taken a pretty good shot at this in the OCaml ecosystem the via OPAM package manager (<a href="https://opam.ocaml.org" rel="nofollow">https:&#x2F;&#x2F;opam.ocaml.org</a>).<p>* 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 the latest XenAPI development trees just requires &quot;opam remote add xapi-dev git:&#x2F;&#x2F;github.com&#x2F;xapi-project&#x2F;opam-repo-dev&quot;.<p>* The same feature applies to pinning packages (&quot;opam pin add cohttp git:&#x2F;&#x2F;github.com&#x2F;avsm&#x2F;ocaml-cohttp#v0.6&quot;). This supports local trees and remote Git&#x2F;Hg&#x2F;Darcs remotes (including branches).<p>* OCaml, like Haskell, is statically typed, and so recompiles all the upstream dependencies of a package once its updated. This lets me work on core OCaml libraries that are widely used, and just do an &quot;opam update -u&quot; to recompile all dependencies to check for any upstream breakage. We did <i>not</i> go for the very pure NixOS model due to the amount of time it takes to compile distinct packages everywhere. This is a design choice to balance composability vs responsiveness, and Nix or 0install are fine choices if you want truely isolated namespaces.<p>* By far the most important feature in OPAM is the package solver core, which resolves version constraints into a sensible user-facing solution. Rather than reinvent the (rather NP-hard) solver from scratch, OPAM provides a built-in simple version and also a CUDF-compatible interface to plug into external tools like aspcud, which are used by other huge repositories such as Debian to handle their constraints.<p>This use of CUDF leads to some cool knobs and utilities, such as the OPAM weather service to test for coinstallability conflicts: <a href="http://ows.irill.org/" rel="nofollow">http:&#x2F;&#x2F;ows.irill.org&#x2F;</a> and the solver preferences that provide apt-like preferences: <a href="https://opam.ocaml.org/doc/Specifying_Solver_Preferences.html" rel="nofollow">https:&#x2F;&#x2F;opam.ocaml.org&#x2F;doc&#x2F;Specifying_Solver_Preferences.htm...</a><p>* Testing in a decentralized system is really, really easy by using Git as a workflow engine. We use Travis to test all incoming pull requests to OPAM, much like Homebrew does, and can also grab a snapshot of a bunch of remotes and do bulk builds, whose logs are then pushed into a GitHub repo for further analysis: <a href="https://github.com/ocaml/opam-bulk-logs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ocaml&#x2F;opam-bulk-logs</a> (we install external dependencies for bulk builds by using Docker for Linux, and Xen for *BSD: <a href="https://github.com/avsm/docker-opam" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;avsm&#x2F;docker-opam</a>).<p>All in all, I&#x27;m very pleased with how OPAM is coming along. We use it extensively for the Mirage OS unikernel that&#x27;s written in OCaml (after all, it makes sense for a library operating system to demand top-notch package management).<p>If anyone&#x27;s curious and wants to give OPAM a spin, we&#x27;d love feedback on the 1.2beta that&#x27;s due out in a couple of weeks: <a href="http://opam.ocaml.org/blog/opam-1-2-0-beta4/" rel="nofollow">http:&#x2F;&#x2F;opam.ocaml.org&#x2F;blog&#x2F;opam-1-2-0-beta4&#x2F;</a>
评论 #8227522 未加载
评论 #8228279 未加载
ownedthx超过 10 年前
Apache Ivy is built on Java and could be a starting point for the uber package manager. It is extremely extensible and can resolve depencies against maven style repos, file systems, and really any other storage mechanism. It can resolve against multiple repos simultaneously.<p>The real problem is that its so powerful and hard to ramp up on... The docs aren&#x27;t sufficient for its overall complexity. That all aside, if the will were there, it could be the git of package managers.
saosebastiao超过 10 年前
From a dumb-user perspective, I feel like most of the effort of package managers is spent on resolving these fundamentally incompatable philosophical dilemmas instead of common-denominator solvable problems like:<p>* Quality and Trust mechanisms. If there are 14 different postgres clients, which do I choose?<p>* Package Metadata management. Where can I send bug reports? Who is the maintainer? How can I contact someone? Is there an IRC channel?<p>* Documentation and Function&#x2F;Class Metadata. Why should I go to the Github README for one package, and to a random domain for another package?<p>* Linking compile and runtime error messages to documentation or bug reports. Why is google still the best way to track down the cause of an obscure error message?<p>* Source data linking and code reviews. I should be able to type in a module&#x2F;namespace qualified function name and view the source without having to scour a git repository. I should also be able to comment directly on that source in a way that is publicly visible or privately visible.
Chris_Newton超过 10 年前
The situation with packages and dependency hell today is horrendous, particularly if you work in a highly dynamic environment like web development.<p>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.<p>To build the front-end, I wanted to use these four tools:<p>- jQuery (a JavaScript library)<p>- Knockout (another JavaScript library)<p>- SASS (a preprocessor to generate CSS)<p>- Jasmine (a JavaScript library&#x2F;test framework)<p>Notice that each of these directly affects how I write my code. You can install any of them quite happily on its own, with no dependencies on any other tool or library. They are all actively maintained, but if what you’ve got works and does what you need then generally there is no need to update them to newer versions all the time either. In short, they are excellent tools: they do a useful job so I don’t have to reinvent the wheel, and they are stable and dependable.<p>In contrast, I’m pretty cynical about a lot of the bloated tools and frameworks and dependencies in today’s web development industry, but after watching a video[1] by Steven Sanderson (the creator of Knockout) where he set up all kinds of goodies for a large single page application in just a few minutes, I wondered if I was getting left behind and thought I’d force myself to do things the trendy way.<p>About <i>five hours</i> later, I had installed or reinstalled:<p>- 2 programming languages (Node and Ruby)<p>- 3 package managers (npm with Node, gem with Ruby, and Bower)<p>- 1 scaffolding tool (Yeoman) and various “generator” packages<p>- 2 tools that exist only to run other software (Gulp to run the development tasks, Karma to run the test suite) and numerous additional packages for each of these so they know how to interact with everything else<p>- 3 <i>different</i> copies of the same library (RequireJS) within my single project’s source tree, one installed via npm and two more via Bower, just to use something resembling modular design in JavaScript.<p>And this lot in turn made some undeclared assumptions about other things that would be installed on my system, such as an entire Microsoft Visual C++ compiler set-up. (Did I mention I’m running on Windows?)<p>I discovered a number of complete failures along the way. Perhaps the worst was what caused me to completely uninstall my existing copy of Node and npm — which I’d only installed about three months earlier — because the scaffolding tool <i>whose only purpose is to automate the hassle of installing lots of packages and templates</i> completely failed to install numerous packages and templates using my previous version of Node and npm, and npm itself <i>whose only purpose is to install and update software</i> couldn’t update <i>Node and npm themselves</i> on a Windows system.<p>Then I uninstalled and reinstalled Node&#x2F;npm again, because it turns out that using 64-bit software on a 64-bit Windows system is silly, and using 32-bit Node&#x2F;npm is much more widely compatible when its packages start borrowing your Visual C++ compiler to rebuild some dependencies for you. Once you’ve found the correct environment variable to set so it knows which version of VC++ you’ve actually got, that is.<p>I have absolutely no idea how this constitutes progress. It’s clear that many of these modern tools are only effective&#x2F;efficient&#x2F;useful at all on Linux platforms. It’s <i>not</i> clear that they would save significant time even then, compared to just downloading the latest release of the tools I actually wanted (there were only four of those, remember, or five if you count one instance of RequireJS).<p>And here’s the big irony of the whole situation. The <i>only</i> useful things these tools actually did, when all was said and done, were:<p>- Install a given package within the local directory tree for my project, with certain version constraints.<p>- Recursively install any dependent packages the same way.<p>That’s it. There is no more.<p>The only things we need to solve the current mess are standardised, cross-platform ways to:<p>- find authoritative package repostories and determine which packages they offer<p>- determine which platforms&#x2F;operating systems are supported by each package<p>- determine the available version(s) of each package on each platform, which versions are compatible for client code, and what the breaking changes are between any given pair of versions<p>- indicate the package&#x2F;version dependencies for a given package on each platform it supports<p>- install and update packages, either locally in a particular “virtual world” or (optionally!) globally to provide a default for the whole host system.<p>This requires each platform&#x2F;operating system to support the concept of the virtual world, each platform&#x2F;operating system to have a single package management tool for installing&#x2F;updating&#x2F;uninstalling, and each package’s project and each package repository to provide information about versions, compatibility and dependencies in a standard format.<p>As far as I can see, exactly none of this is harder than problems we are already solving numerous different ways. The only difference is that in my ideal world, the people who make the operating systems consider lightweight virtualisation to be a standard feature and provide a corresponding universal package manager as a standard part of the OS user interface, and everyone talks to each other and consolidates&#x2F;standardises instead of always pushing to be first to reinvent another spoke in one of the wheels.<p>We built the Internet, the greatest communication and education tool in the history of the human race. Surely we can solve package management.<p>[1] <a href="http://blog.stevensanderson.com/2014/06/11/architecting-large-single-page-applications-with-knockout-js/" rel="nofollow">http:&#x2F;&#x2F;blog.stevensanderson.com&#x2F;2014&#x2F;06&#x2F;11&#x2F;architecting-larg...</a>
评论 #8228858 未加载
xsace超过 10 年前
Dependency management (ie class&#x2F;script&#x2F;resource loading) is too coupled with the programming language execution environment.<p>It&#x27;s not something you can make generic like a file&#x2F;folder based version control tool. It&#x27;s like asking for the Git of unit testing&#x2F;continuous integration or whatever, not going to happen.
评论 #8227766 未加载