Follow

Is Rust a Node.js-like dependencies hell?

Example: "Rand" is not native, and the official library has 15 dependencies... 🤔

@angristan J'ai bien l'impression que oui, et c'est un peu le drame des packages managers modernes : plein de facilités pour la gestion des dépendances, ça mène à une non-gestion complète des dépendances. :-(

@angristan That's a good question!

It looks to me that it's not quite as bad as npm? The packages aren't quite as small (it's "implement this RNG", not "add some spaces to a string"), and some are built from the same repo - those "rand_*" ones.

The worst here is "rustc_version", which ends up shelling out to call `rustc -v`, just to then parse the version, which this then uses to conditionally compile stuff. I'd say that should be part of the language - even C has some here!

@angristan Rust being a compiled language, small dependencies have a small impact on code size and startup time. Alas, having many deps *does* affect compile time and link time. It's the price of modularity and code reuse.

Sign in to participate in the conversation
Mastodon

mstdn.io is one of the instance in the fediverse. We're an open-minded generalistic instance. Learn more here!