4 ms·
I don't agree at al with his analysis of the crate ecosystem. I'd love to see either the standard library grow considerably or some semi-standard major libs to
by hyperman1 4y ago
I don't agree at al with his analysis of the crate ecosystem. I'd love to see either the standard library grow considerably or some semi-standard major libs to appear.
For example, you find a crate that seems to do what you need. 1) are you sure it has high enough quality? 2) Is the license compatible with your needs? 3) What long term guarantees exist for API stability? 4). Is it actually maintained?
All of this needs checking off. If you don't do them, your project will be a sprinter, not a marathon runner, as dependency addition is cheap but dependency maintenance is a slow burning major cost.
The transitive dependencies make it worse, as they need independent vetting.
This cost is acceptable for major libs, but the zillion 100-line left pad ish libs have to go.
I'd love to have some standard rust guarantee declaration, including at least the declaration of the author's intent. You won't maintain something or won't stabilize an API? Fine, your project, your rules. But don't make me hunt for that info.
- zppln 4y agoI haven't written a lot of Rust, but every time I do I find myself trying to do something rather basic, google around a bit, only to have people telling me to just install crate so and so. While I do see the advantages of this and all, it also stops me from learning the basics.
- sshine 4y agoIf I understand what you're saying, this is to be expected from any mature ecosystem: The basic things have been solved by libraries that everyone generally prefers to use. Wanna write a JSON parser? You can, but there's a library for it. And so on. For the purpose of learning the basics, you can either disregard the library, or you can write an app that uses a bunch of libraries.
- WesolyKubeczek 4y agoDisregard the crate, write your own thing. Then have a look at the crate and compare notes. That’s how you learn. Just pretend they don’t exist for a while. This attitude has some other uses, too.
- proto_lambda 4y agoYou need to communicate clearly that you are doing these things as a learning exercise, not just because they're a requirement for something bigger that you're actually trying to do. People try to be helpful by saving you unnecessary work, not realizing that the work is your actual goal.
- mcronce 4y agoIt's worth reinventing the wheel for the purpose of learning those low-level bits, if that's something you want to learn. For example, I feel like every week I see a new NES or Gameboy emulator posted on /r/rust The nice thing about well-solved problems in libraries is that you don't have to learn how to write those things if you don't want to
- tmtvl 4y agoThe way Cargo pins dependencies always makes me nervous. One of the "new crates" on crates.io has a dependency that is 3 years out of date, rather than depending on the newest version. It just makes me wonder how many bug fixes aren't getting propagated, potentially spreading serious issues. I realise that the C way of "packages that aren't kept up-to-date just break" is less than ideal, but after the Log4J thing happened I'm wary.
- majewsky 4y agoThe rather small stdlib of Rust is a learning from Python: Python's stdlib really does have "everything and the kitchen sink", but lots of modules will have caveats like "do not use urllib2, use requests from PyPI instead". The biggest reason for this is that the stdlib has a much stronger backwards-compatibility guarantee than any library, so any bad API choice is set in stone forever until Python decides to do another major version bump. (And we all remember how smoothly the last one went.)
- hyperman1 4y agoI understand very well. The JDK has the same problem. But both are in better shape than the node ecosystem. I have no problems with major libraries, and I understand why rust is sometimes slow to stabilize things, even if ut is sometimes frustrating to see the thing you need in there but not ready for prime time. But minor libraries or deep dependency chains are another thing. So my hope is to have a few big libearies, subscribing to some standard of stability. You can then make an informed choice between the exciting bleeding edge or the boring stable world.
- pornel 4y agocrates.io isn't npm. A lot of mess in npm is specific to npm, Node and JS. I need to rm -rf node_modules regularly. Cargo works every time. Node makes breaking changes regularly and intentionally. Rust releases are checked against all crates-io crates to avoid breaking anything. JS has dynamic typing, monkey patching, and a drama around modules. Rust has very clear and strict library interfaces. Cargo is much more reliable than the npm client. Has lock files that work. Left-pad scenario has been fixed at npm long time ago, and has never been possible at crates-io.
- pjmlp 4y agoAs counterpoint, I can be assured everywhere there is a compliant Python version, I can rely on those features being available. With 3rd party libraries is hit and miss regarding cross platform portability.
- pas 4y agoThere was a lot of talk about a standard set of semi-blessed crates. What happened to that initiative? Does anyone happen to know?
- steveklabnik 4y agoA few people have tried it over the years. They never gain traction. Turns out the current state of things is more popular in actual practice.