Live data from Hacker News

Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

github.com

21–30 of 57 posts

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#21
post #4

Earlier quoted context omitted.

You stopped reading because the author used ChatGPT to create a summary of an article they wrote themselves? This may actually be the best use case for ChatGPT.

Depending on how exactly you mean use, I would not say so, because chatgpt cannot actually summarize anything. In this case it may be ok because we may assume the author looked over the result and agrees with it. They could remove the citation as far as I'm concerned, the same way they don't have to cite their spell checker. But a summary is a distillation of an understanding. chatgpt does not understand anything, it…

You claim that ChatGPT cannot understand anything because it merely pattern matches. Humans are basically pattern matching machines, we are just currently better than our computer counterparts. Do humans understand anything? I find this debate over whenever a computer can understand anything rather pointless. If something can produce useful output I don't care if it 'actually understands' anything.

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#22

This will make the chaos worse. Instead of having to figure out compatible versions of dozens of packages, you will now have to figure out compatible versions of thousands of functions. The solution to dependency chaos is grouping dependencies together and versioning the larger group, not splitting into even more dependencies.

I think at this point we should quantify the proportion of "inflationary" updates (i.e. those that bring absolutely nothing in terms of functionality or security) versus real updates.

Let's take a fictional example: I import D3.js to use the parseDSV() function, after 2 years the method has not received any updates, but the package has gone from version 1.0.2 to 5.0.2. With a granular system, my function would still be on version 1.0.2 (because no changes were made), but with the current system I would have received an unnecessary update.

So, in this case, granular versioning would actually help to put an end to the chaos of dependencies.

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#23
Version numbers are just part of a name; we can't rely on them, any more than we can rely on package names (e.g. anyone can make a package with the name "aws-sdk"; that doesn't mean they can be trusted with our AWS credentials!)

To actually get dependencies for our software, we need two mechanisms:

- (a) Some way to precisely specify what we depend on

- (b) Some mechanism to fetch those dependencies

Many package managers (NPM, Maven, etc.) use a third-party server for both, e.g.

- (a) We depend on whatever npm.org returns when we ask for FOO

- (b) Fetch dependency FOO by attempting to HTTP GET https://npm.org/FOO; fail if it's not 200 OK

Delegating so much trust to a HTTP call isn't great; so there's an alternative approach based on "lock files":

- (a) We depend on the name FOO with this hash (usually 'trust on first use', where we find the hash by doing an initial HTTP GET, etc. and store the resulting hash)

- (b) Fetch dependency FOO by looking in these local folders, or checking out these git repos, or doing a HTTP GET against these caches, or against these mirrors, or leeching this torrent, etc. Fail if we can't find anything which matches our hash.

The interesting thing about using lock files and hashes, is that our hash of dependency FOO depends on the contents of its lock file; and that content depends on the contents of FOO's dependencies, including their lock files; and so on.

Hence a lock file is a Merkle tree, which pins all of the transitive dependencies of a package: changing any of those dependencies (e.g. to update) requires altering all of the lock files in-between that dependency and our package. That, in turn, alters our lock file, and hence our package's hash.

The author is complaining that such dependency-cascades require a whole bunch of version numbers to get updated. I think it's better to keep track of these things separately: use your version number as documentation, of major/minor/patch changes; and keep track of dependency trees using a separate, cryptographically-secure hash. The thing is, we already have such hashes: they're called git commit IDs!

Other advantages of identifying transitive dependencies with hashes:

- They're not sequential. Our package isn't "out of date" just because we're using hash 1234 instead of 1235. All that matters are the version numbers. In other words, we're distinguishing between "real" updates (a version number changed) and "propagation" (version numbers stayed the same, but a dependency hash changed).

- They're unstructured; e.g. they give us no information about "major" versus "minor" changes, etc. (and hence no need to decide whether an update is one or the other!)

- They can be auto-generated; e.g. we might forget to update our version number, but there's no way we can forget to update our git commit ID!

- They're eventually-consistent: it doesn't matter how updates 'propagate' through each package; each sub-tree will converge to the same hash (NOTE: for this to work we must only take the content hash, not the full history like a git commit ID!).

For example, take the following ("diamond") dependency tree:

                      +--> B --+

                      |        |

  Our package --> A --+        +--> D

                      |        |

                      +--> C --+
When D publishes a new version, B and C should update their lock-files; then A should update its lock-file; then we should update our lock-file. However, this may happen in multiple ways:

- B and C update; A updates (getting new hashes from B and C)

- B updates; A updates; C updates; A updates

- C updates; A updates; B updates; A updates

Using version-numbers (or git commit IDs!) would result in different A packages (one increment versus two increments; or commit IDs with different histories). Using content hashes will give A the same hash/lock-file in all three cases. This also means we're free to propagate updates whenever we like, rather than waiting for things to 'stabilise'; and it's safe to use private forks/patches for propagating updates if we like, without fear of colliding version numbers.

Note that some of this propagation can be avoided if our build picks a single version of each dependency (e.g. Python requires this for entries in its site-packages directory; and Nixpkgs uses laziness and a fixed-point to defer choosing dependencies until the whole set of packages has been defined)

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#24
post #4

Earlier quoted context omitted.

You stopped reading because the author used ChatGPT to create a summary of an article they wrote themselves? This may actually be the best use case for ChatGPT.

Without saying one thing or another about the bots ability or propriety, I'd still argue that if the burden of summarizing succinctly something you wrote is so great that you need to pull out high-powered AI technology to do it, you should probably should spend some more time thinking about what you are writing. Who cares about pure velocity if you are really trying to communicate something? We shouldn't measure writ…

I am the author of the post. The reason is that English is not my native language, and summarizing is very resource-consuming for me, much more than if I had to do it in my native language. But I take note of the antagonistic aspect and I will make sure to rewrite the summary ;)

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#25
post #21

Earlier quoted context omitted.

Depending on how exactly you mean use, I would not say so, because chatgpt cannot actually summarize anything. In this case it may be ok because we may assume the author looked over the result and agrees with it. They could remove the citation as far as I'm concerned, the same way they don't have to cite their spell checker. But a summary is a distillation of an understanding. chatgpt does not understand anything, it…

You claim that ChatGPT cannot understand anything because it merely pattern matches. Humans are basically pattern matching machines, we are just currently better than our computer counterparts. Do humans understand anything? I find this debate over whenever a computer can understand anything rather pointless. If something can produce useful output I don't care if it 'actually understands' anything.

You are equating or confusing appearance with essense.

An mp3 player that says "hello" is not greeting you, and you are not merely playing a recording of the sound "hello" at your neighbor.

A person can do many of the same outward actions as a machine. A machine can be made that carries rocks. You can also carry rocks. This does not make you really no different from a truck.

So a person can pattern-match, and write formulaically.

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#26

I don’t think the proposal helps as it puts more burden on package maintainers (honourable semvar for the whole package is burden enough!). The problem is in NPM culture, and how much churn there is in packages and especially unnecessary breaking changes. Avoid that and then the problem is reduced from constantly fighting to play API keepup to simply letting security updates flow through. Let your patch version numbe…

I think churn in NPM might be an effect of how quickly the browsers and language are evolving. There’s always some new interface that will make your existing code faster or cleaner.

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#27

I don’t think the proposal helps as it puts more burden on package maintainers (honourable semvar for the whole package is burden enough!). The problem is in NPM culture, and how much churn there is in packages and especially unnecessary breaking changes. Avoid that and then the problem is reduced from constantly fighting to play API keepup to simply letting security updates flow through. Let your patch version numbe…

I think churn in NPM might be an effect of how quickly the browsers and language are evolving. There’s always some new interface that will make your existing code faster or cleaner.

My sense it is cultural. If there's no consequence for breaking stuff then stuff gets broken. Other languages have a stronger culture of shame from breaking stuff.

Re: Ending Dependency Chaos: A Proposal for Comprehensive Function Versioning

#28
Doesn't just stopping using version ranges also help with this? I've never understood why people would allow a package manager to update a piece of their code for them automatically. Using specifiers like ^1.5.3, allowing package manager to go all the way up to version 1.999 automagically is just asking for trouble.

Find a set of versions that is self-compatible and works, and pin all your versions to those specific versions, with a hash if possible. Upgrade on your schedule, not someone else's. Thoughts?

Post reply on HN