3 ms·
> Dart’s pub includes a simple backtracking solver that often takes a long time. I'll note two things: 1. The backtracking solver isn't that simple. It's got
by munificent 10y ago
> Dart’s pub includes a simple backtracking solver that often takes a long time.
I'll note two things:
1. The backtracking solver isn't that simple. It's got a handful of pretty smart heuristics that we've added over time to help it get stuck.
2. It doesn't get stuck very often. It does happen. In particular, our ecosystem has one package that is very heavily depended on and also frequently ships breaking changes, which is always a recipe for version solver pain.
But pub works fine for probably >99% of invocations of it. Installing dependencies is a gating issue for getting any work done, so if pub was getting stuck often, users would be screaming at us.
Also, Natalie, the other half of the pub team, put together a comparable proof of version solving being equivalent to 3-SAT a year or two ago, but I can't seem to find it now.
Personally, I think the idea of treating breaking versions of packages as distinct and allowing them to co-exist is interesting but I worry about the usability impact of it. It will be very confusing for users if objects flow between those two packages and you get type errors like "Expected type Foo but got Foo." Good error messages can help a lot, though.
- wfunction 10y ago> It's got a handful of pretty smart heuristics that we've added over time to help it get stuck. I assume you mean NOT get stuck? Or do you mean something else like settling on a solution?
- munificent 10y agoHeh, oops, yes. Help it find a solution. :) Leaving my mistake to bear my shame publicly.
- rsc 10y agoHi Bob, Agree about "simple" being a bad choice of name. What I meant is that it's not one of the crazy souped up SAT solving algorithms directly. I'll drop "simple". FWIW we've seen those kinds of type errors in Go already with vendoring, which lets you have multiple copies of the same package. Good errors are essential (and we only get them half right). Thanks.