this post was submitted on 28 Mar 2024
247 points (94.6% liked)
Rust
5989 readers
39 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Rust had the same issue with tokio vs. async-std. I don't think this was ever resolved explicitly, async-std just silently died over time.
Hmm, sort of, although that situation is a little different and nowhere near as bad. Rusts type system and feature flags mean that most libraries actually supported both tokio and async-std, you just needed to compile them with the appropriate feature flag. Even more worked with both libraries out of the box because they only needed the minimal functionality that
Future
provided. The only reason that it was even an issue is thatFuture
didn't provide a few mechanisms that might be necessary depending on what you're doing. E.G. there's no mechanism to fork/join in Future, that has to be provided by the implementation.async-std still technically exists, it's just that most of the most popular libraries and frameworks happened to have picked tokio as their default (or only) async implementation, so if you're just going by the most downloaded async libraries, tokio ends up over represented there. Longer term I expect that chunks of tokio will get pulled in and made part of the std library like
Future
is to the point where you'll be able to swap tokio for async-std without needing a feature flag, but that's likely going to need some more design work to do that cleanly.In the case of D, it was literally the case that if you used one of the standard libraries, you couldn't import the other one or your build would fail, and it didn't have the feature flag capabilities like Rust has to let authors paper over that difference. It really did cause a hard split in D's library ecosystem, and the only fix was getting the two teams responsible for the standard libraries to sit down and agree to merge their libraries.