Remix.run Logo
▲ mort96 33 minutes ago

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.