4 ms·
> In C++, I control my dependencies. In Rust I get above 100 so quickly I just Just don't add dependencies, it's that simple. If you have enough time to contro
by Ygg2 2y ago
> In C++, I control my dependencies. In Rust I get above 100 so quickly I just
Just don't add dependencies, it's that simple. If you have enough time to control C++ dependencies, you can control them in Rust as well.
- lolinder 2y agoThat's not an answer when the entire ecosystem is built around the idea of adding lots of dependencies to do stuff. I don't need no dependencies, I'd like to live in a world where I can add two or three. But if the culture is so far gone that those two or three transitively import 20 each, I don't have that as an option—it's all or nothing.
- Ygg2 2y ago> That's not an answer when the entire ecosystem is built around the idea of adding lots of dependencies to do stuff. Again. Don't add dependencies. Just don't. Vendor it yourself. Or write it yourself. Absolutely nothing is forcing you to use the dependencies except your own desire to save time. Cargo is giving you the option to A) save your own time B) minimize dependencies. You choose A) and blame Cargo.
- palata 2y agoI don't think it's entirely fair. You're telling me "don't use any dependency at all". Vendoring is not a solution, because it does not remove the transitive dependencies. So I have to essentially rewrite it myself. I find many libraries in C++ that don't pull 20 dependencies. It's common for me to have a C++ project that has ~6-8 dependencies. In Rust I have never seen that. Either I have no dependency at all, or I have 100+. I actually had this toy project that I wrote both in C++ and in Rust, for the learning experience. Both did exactly the same thing, with a very similar design. In C++ I had 8 dependencies. In Rust, 186. The thing is, 186 is enough for me to not even read all their names in the lock file. As soon as 25 dependencies magically appear in my lock file, I stop caring and start YOLOing it.
- Ygg2 2y ago> Vendoring is not a solution, because it does not remove the transitive dependencies. So I have to essentially rewrite it myself. Vendoring means, you fork it, make any modification you want, such as reducing the number of dependencies, but keeping it up to date with upstream is on you. Rewriting it for yourself is what happens in C++. C++ didn't get flatter by waving a magic wand, it just moved the slider. It's just that code reuse is hard, so you rewrite things that would be a shared dependency in Rust into a header file and call it a day. > I find many libraries in C++ that don't pull 20 dependencies. I can find many libraries in Rust that don't pull 20 dependencies (mostly by searching crates written by people like the_mitsuhiko). Some people care, but they are a minority. If you truly care about this, like the_mitsuhiko does, write it with no dependencies. I, personally, try to minimize my dependencies, but there is a reason why most people don't care - it has little to no impact on them and saving time by NIH is better than not learning from history and reinventing wheel only square. --- Problem is: There are infinitely many of properties to improve (number of dependencies, byte size, compile time, run time, alignment, crates not made by X, time to market, reproducibility, compliance with law XYZKM, safety etc.) and not enough time or possibility space to do them all.
- lolinder 2y ago> Vendoring means, you fork it, make any modification you want, such as reducing the number of dependencies, but keeping it up to date with upstream is on you. This is not what vendoring means, this is called forking. Vendoring is just the copy+commit phase, not the modification part.
- deleted 2y ago[deleted]
- Ygg2 2y agoDunno. That's what one project I worked on called it. Forking code on GH, pulling as submodules and maintaining it (most repos were unmaintained for years).
- palata 2y ago
- deleted 2y ago[deleted]