Remix.run Logo
▲ arendjr 28 minutes ago

There’s lots of things we “should” do but don’t. I can agree with you that having lots and lots of transitive dependencies isn’t a good thing, but the thing is, it does remove a lot of day-to-day headaches for people and allows them to work at speeds they couldn’t before. That’s a good thing for them that they value at the expense of most other things.

People want results first, optimisation later. This gives them that.

There’s also a good argument to be made that you shouldn’t always give people what they want, but it’s easy to see why Cargo is so popular.

▲mort96 19 minutes ago | parent [-]

I agree with your premise and disagree with your conclusion.

There's a lot we "should" do but don't. That's exactly why I think incentives are so important. When I want to add a Cargo dependency, I should look through every dependency that was added after running 'cargo add' and vet it. But I don't, because it's so easy to not do that.

If I had to run 'cargo add' for each transitive dependency manually, there would be two positive effects:

1. I would be forced to at least be aware of which transitive dependencies I'm adding, I can't just ignore them anymore. This is at least a part of the vetting I should be doing today but don't.

2. It would incentivise libraries to use fewer dependencies, because each one would add extra work for the user. The C++ ecosystem has a ton of those "dependency-free header-only" libraries because both being header-only and being dependency-free makes adoption easier in C++. A similar (though lesser) phenomenon would affect Rust if Cargo made you manually add each transitive dependency.