4 ms·
All these packages provide important pieces of functionality, which, I suppose, mostly cannot be omitted. Either you depend on other's work for that, or you ro
by nine_k 6y ago
All these packages provide important pieces of functionality, which, I suppose, mostly cannot be omitted.
Either you depend on other's work for that, or you roll your own. Choose your poison.
- est31 6y agoA quick survey gave me: * tracing is only present for logging purposes. does curl need it? It should be configurable. * itoa is only present for performance purposes, and only seems used by the server. * It seems that a bunch of projects in the dependency tree use pin-project which is heavyweight and instead could use pin-project-lite. Some already do, which creates both being used, so you are worse off than just with pin-project alone... * hyper contains code for both http servers and clients. Even if the dependencies are the same (and as seen above they are not), having to compile the server code for the client means an increase in compile time. It would be cleaner to provide separate server and client flags to make it possible to turn one off.
- nicoburns 6y agoThe latter is scheduled for the next release https://github.com/hyperium/hyper/issues/2223 https://github.com/hyperium/hyper/issues/2223
- cle 6y agoThere’s a third option if the package is so important: put it in the standard library. Technically it’s still a dependency but the standard library is maintained with a standard that is rarely matched by third party libraries, and can dramatically simplify the ecosystems’ dependency graph.
- nextaccountic 6y agoCurrently the mpsc channel on the stdlib is worse than the one found on crossbeam (according to the author[0]). That's one data point. [0] https://internals.rust-lang.org/t/scaling-back-my-involvement-in-rust/11754 https://internals.rust-lang.org/t/scaling-back-my-involvemen...
- steveklabnik 6y ago> with a standard that is rarely matched by third party libraries I mean, you can go both ways with this. Standard libraries are significantly more difficult to work on than third party libraries, and I've seen a lot of code in standard libraries that is objectively worse than ecosystem equivalents because of it.
- cle 6y agoI agree, there's no silver bullet, only tradeoffs and our appetites for them. From looking at the list of crates above, I see a lot that are often part of the stdlib of other languages, such as HTTP, concurrency/nio primitives, and logging. My perception of Rust's not including such fundamental primitives in the standard library is that Rust is still very much experimental, and the ecosystem values tinkering and experimenting with new ideas. The cost of that is increased dependency hell, especially over time. There's obviously huge value in experimentation for the industry, but it makes me hesitate to use Rust for projects where I just need to get stuff done, and stay done.
- steveklabnik 6y agoHTTP libraries are a prime example of where many, many standard libraries are considered old and crufty, and there are much better ecosystem libraries that end up being wildly used more. You may have that perception, and that is fine, but it's not likely to be a thing that changes significantly, even when Rust is quite old. There's just not a lot of advantage to being in the standard library, and numerous downsides.
- cle 6y agoWe should be more nuanced than that. There are also many standard libraries where the HTTP implementation is the standard. Why? > There's just not a lot of advantage to being in the standard library, and numerous downsides. Look at those huge lists of dependencies and the complaints of Cargo dependency hell. That's the downside. Every node in your dependency graph has overhead for everyone involved, and it's even worse when it's something as fundamental as HTTP.
- the8472 6y agoRust's standard library is intentionally kept small since it's initially not always obvious what the best solution is and the stability guarantee makes it the wrong place for evolving, diverse or opinionated APIs. E.g. the async ecosystem offers you to pick between runtimes of different complexity and tradeoffs. Std only picked up the essential traits that allow other crates to interoperate with each other and the language itself to define async functions.
- ccktlmazeltov 6y agohopefully at some point they start including more batteries