Live data from Hacker News

The vgo proposal is accepted. Now what?

research.swtch.com

101–110 of 138 posts

Re: The vgo proposal is accepted. Now what?

#101
post #63

Earlier quoted context omitted.

In that scenario, you're going to get a merge conflict anyway in your manifest (e.g. in go.mod).

It's probably easier to manually merge the manifest (as they're much more human-readable) than a lock file though.

Lock files are easy enough to resolve that npm, in newer versions, will do it for you automatically, if you ask it to.

Re: The vgo proposal is accepted. Now what?

#102
post #96

Earlier quoted context omitted.

> The speed of the solver is not a problem in any other package management system I've seen really ? It has been a large problem in Debian for instance and has enabled a lot of research ( https://scholar.google.fr/scholar?q=debian+solver ). One of the reason for Fedora's yum -> dnf change was also a change of solver. It's a hard problem that affects a lot of people.

To clarify, I(and the OP) was specifically talking about programming language specific package managers.

puppet dependency managers have also been an issue it's certainly easy to solve poorly

Re: The vgo proposal is accepted. Now what?

#103
post #52

Earlier quoted context omitted.

There are a lot of suboptimal design decisions that's shared across the state of the art in package management (cargo, pipenv, npm, yarn, etc) that the Go team is not taking for granted. One is reproducible builds. The standard answer is lock files which is extra bloat and leads to merge conflicts. vgo is trying to avoid it with the "minimal versions" strategy ( https://research.swtch.com/vgo-repro ). Another is shar…

The "minimal versions" strategy basically just replaces the lockfile with your dependency list. Two branches want to update the same dependency? With a lockfile, they both update the lockfile and will have a merge conflict (assuming the updates aren't identical). With "minimal versions", they both update the file that declares the dependency, and, you guessed it, have a merge conflict.

Minimal versions put the burden of background compatibility on the maintainer of the dependency. If such is the case, library maintainers are constrained to refrain from breaking background compatibility at minor version changes, like Go itself does. In this case, you can merge, resolve the conflict by incrementing the dependency's version number, rebuild and retest and if all goes well commit. With lockfiles if branch X requires 1.4, branch Y requires 1.5 and 1.5 breaks 1.4, good luck with that. You'll need to update branch X to support 1.5.

Re: The vgo proposal is accepted. Now what?

#104
post #64

Earlier quoted context omitted.

Rust was actually around for a good while before Cargo was adopted. (In fact, there were two Cargos, the older of which bore very little resemblance to the Cargo of today.) Of course, Go was stable for longer. I have to admit I'm a bit confused as to why the dependency resolution algorithm in dep is seen as slow. The speed of the solver is not a problem in any other package management system I've seen. If it is indee…

> The speed of the solver is not a problem in any other package management system I've seen This! I've never heard anyone complain about this aspect of a package manager, EVER. vgo seems to be optimizing for a problem no one has.

Scala / SBT has a particularly slow dependency resolution

Re: The vgo proposal is accepted. Now what?

#105

Earlier quoted context omitted.

Cargo performs dependency resolution, so fetching from git would (and does) significantly slow it down - it wound need to perform git operations to get the tags for each dependency (quick) and then checkout each tag to look for the subdependencies of that package at that version (slow). Having a central registry is a must for package managers that perform version resolution and want to do so quickly, as it can serve…

My perception is that the initial clone is slow, but that’s it. A detailed comparison with actual numbers would be interesting! When you depend on a git dep, you can say if you want a particular branch, tag, rev, whatever. So it’s only a clone + checkout. From there you read the Cargo.toml, same as anything else. That’s my understanding anyway, it’s been a while since I poked at the guts.

You’re totally right - I was thinking of Composer, which does flat resolution for git sources so has to go through the above. Cargo sidesteps that issue completely by taking the head commit or whatever’s asked for :-)

Re: The vgo proposal is accepted. Now what?

#107
post #52

Earlier quoted context omitted.

There are a lot of suboptimal design decisions that's shared across the state of the art in package management (cargo, pipenv, npm, yarn, etc) that the Go team is not taking for granted. One is reproducible builds. The standard answer is lock files which is extra bloat and leads to merge conflicts. vgo is trying to avoid it with the "minimal versions" strategy ( https://research.swtch.com/vgo-repro ). Another is shar…

The "minimal versions" strategy basically just replaces the lockfile with your dependency list. Two branches want to update the same dependency? With a lockfile, they both update the lockfile and will have a merge conflict (assuming the updates aren't identical). With "minimal versions", they both update the file that declares the dependency, and, you guessed it, have a merge conflict.

Most package managers ignore the lock files of the dependencies when picking up versions - they only use the lockfile of the topmost project for picking up versions.

The big difference with the MVS strategy in vgo is that the dependency list of a dependency is actually used to determine the version. If package A uses B, which was tested with v1.2 of package C, you will get v1.2 of C, even if there is a later version of C available.

In the typical package manager scenario, the dependency list of B may be pointing to an old version of C which does not even work with B - there is generally no way to ask : give me the latest version of C which was tested with B.

Re: The vgo proposal is accepted. Now what?

#108
post #41

What does this mean for someone who is starting out with Go?

Nothing. Use dep now. In fact, since you are just starting out, see how far you can get using only the standard library. Later, there will be a seamless upgrade to vgo.

Seconded. Unlike Node/Ruby/most other modern languages, Go devs actively avoid including dependencies if at all possible.

And contrary to rumour, this is not because Go's dependency management sucks. It's more about the pursuit of simplicity, and avoidance of magic.

You can write pretty much anything using just the standard library (and some of the official packages, like the crypto ones). As the parent said, it's good practice to go as far as possible with just the stdlib.

Re: The vgo proposal is accepted. Now what?

#109
post #90

Earlier quoted context omitted.

> Now Cox's solution might indeed be better (though I think it's an overkill ... vgo is actually much, much simpler than dep. The sheer number of words in Russ Cox's series of blog posts belies its simplicity. vgo doesn't need a SAT solver. If you look at many of the issues dep is struggling with, they're related to solving N libraries with transitive dependencies up the wazoo. Cox's long treatise reflects the comple…

Simpler does not mean better. ed(1) is definitely simpler than any text editor out there. DOS is simpler than any modern OS out there. Yet we use none of these because complexity is needed for sophistication.

>Simpler does not mean better.

Doesn't mean worse either. If it solves the same problem as dep in a less complex way I'd say it's better, if it actually does is something we'll see once it sees adoption.

Re: The vgo proposal is accepted. Now what?

#110
post #52

I wish they had just copied Rust/Cargo. I remember reading a comment on GitHub somewhere from one of the Go maintainers who responded to someone expressing a similar sentiment and his reply was basically that Go is somehow different than every other language and they need to explore and find a unique custom solution for their particular use case. Has it ever been addressed anywhere why the tried and true "list of pac…

There are a lot of suboptimal design decisions that's shared across the state of the art in package management (cargo, pipenv, npm, yarn, etc) that the Go team is not taking for granted. One is reproducible builds. The standard answer is lock files which is extra bloat and leads to merge conflicts. vgo is trying to avoid it with the "minimal versions" strategy ( https://research.swtch.com/vgo-repro ). Another is shar…

>One is reproducible builds. The standard answer is lock files which is extra bloat and leads to merge conflicts.

You can’t have your cake and eat it too

Post reply on HN