3 ms·
I'd say that Rust's crate ecosystem is of a different character than Node's. There's no culture of "microdependencies" like `is_odd` in Rust, likely because Rus
by kibwen 4y ago
I'd say that Rust's crate ecosystem is of a different character than Node's. There's no culture of "microdependencies" like `is_odd` in Rust, likely because Rust's stdlib isn't small per se; it is slightly narrow (without things like HTTP libraries) but very deep (the modules that do exist are very thorough). Overall, Rust crates are "topic-oriented" rather than "convenience-oriented". Node achieves fine-grained APIs via a proliferation of small dependencies, whereas Rust does the same via feature profiles within a single crate.
- Thaxll 4y agoAnd yet Rust import tons and tons of package for anything, so yes you don't have that `is_odd` but your dep tree if very often bloated.
- deleted 4y ago[deleted]
- mplanchard 4y agoFor some definition of bloated, maybe. Our codebase at work has I think 15-20 crates in our workspace, powering two independent applications and three dev-tooling-related binaries. All of this provides the main functionality for our business. We have fewer than 500 Rust dependencies in our Cargo lockfile, including dev dependencies. Meanwhile, our relatively simple react frontend and graphql server written in TS have over 20k dependencies. It’s truly a different order of magnitude.
- Aeolun 4y ago20k? I’m willing to believe you can hit 5k, but that’s already stretching credulity. At some point all the common packages are installed.
- mplanchard 4y agoOkay you appear to be right! Running `yarn info -AR | wc -l` gets me 3,413, and I get the same number for `cat yarn.lock | rg '^".+":$' | wc -l` I remember running `yarn install` before we switched to `yarn 2` used to get us some absolutely insane number of packages being fetched in the 20k+ range, which is where my number came from, but I hadn't looked at it again in quite a while. I'll update my original comment. (edit: nvm it's too old to update, oh well)
- Aeolun 4y agoHaha, no problem of course. If someone did have a 20k package lock file I would’ve been really curious what was inside ;)