5 ms·
Isn't async-std interface the future of async at this point? It seems that there's still a huge split inside the community between async-std and tokio interfac
by xiphias2 7y ago
Isn't async-std interface the future of async at this point?
It seems that there's still a huge split inside the community between async-std and tokio interfaces that should be resolved ASAP.
Is there some working group to help standardizing the interfaces and upgrade tokio based apps to the standard?
- swsieber 7y agoNo, it's not the standard. There has been some friction between the two groups (tokio and async-std) unfortunately. I'm not sure what the original source of friction was, but bad feelings seem to seep out when the projects are discussed in active Rust communities. I wonder how long the drama will go on. But at least both parties seem to be trying to be civil about it (and succeed).
- bluejekyll 7y agoFolio => Tokio
- zozbot234 7y agoThere's nothing "standard" about async-std as of yet. The name is because it tries to build something that can be used just like std library facilities, except for the async support.
- Argorak 7y agoYou are right, but I also want to point out that we fully buy into the futures-rs interface over custom implementations.
- oconnor663 7y ago> should be resolved ASAP I'm not sure having multiple runtimes is such a problem. The Rust async IO model was explicitly designed to accommodate different runtimes. There are a lot of tradeoffs around how a runtime does multi-threading, for example, and embedded systems may also do their own thing. Tokio vs async-std might or might not make sense as a long term split, but I think it's too early to say.
- xiphias2 7y agoI think the main clash was not about runtime differences but about the interface incompatibility (futures.rs) There's a bug for it in Tokio, but it's low priority as far as I know. https://github.com/tokio-rs/tokio/issues/1297 https://github.com/tokio-rs/tokio/issues/1297
- steveklabnik 7y agoIt's not particularly low priority https://github.com/tokio-rs/tokio/pull/1744 https://github.com/tokio-rs/tokio/pull/1744 (See the last section in particular)
- xiphias2 7y agoOh, so there's a pull request that I didn't see, the bugs don't show that it's being worked on. I understand that there are lots of hard technical issues to be resolved, it's just the visibility of this pull request wasn't that good. Thanks for the answer! Very interesting thread.
- twic 7y agoThis is a great thread! Lots of different perspectives on a difficult technical problem, plus appearances from many of my favourite Rust characters: we've got Ralf telling everyone that only abstract machines exist, boats turning up halfway through to contradict everyone, and Douman dropping by to offer the unhelpful C++ perspective.
- Argorak 7y ago> I think the main clash was not about runtime differences but about the interface incompatibility (futures.rs) There is a huge amount of complaints just fundamentally about async-std's existence, though.
- Argorak 7y agoThe position of the async-std project is that people should use _futures-rs_ as the integration point and avoid integrating into tokio or async-std if possible. (both are IO optimised) Especially for things like an actor system, I would recommend to not use either, but instead spawn a dedicated number of threads handling the actors. This allows you to be specifically optimised to the problem. bastion is a great example for that. async-std ships a second library called "async-task", which implements just the task/future allocation component and allows you to quickly implement your own runtime. Full disclosure: I'm one of async-std's maintainers.
- xiphias2 7y agoI understand this, but it still doesn't answer the main point: are you working together with tokio maintainers to move to futures-rs as soon as possible and even extend the interface of futures-rs more if needed? In my view the separate interfaces increase the long term damage that new libraries are creating every day, and it should be higher priority to resolve it together before implementing new features in either of the two libraries (async-std and tokio).
- Argorak 7y agoWe don't maintain futures-rs. But for the reasons you outline above (stability), our interface is also effectively done. The choice of not using all of futures for their interface is outspoken the strategy of tokio. We have encouraged them to prefer the futures layers, but we don't see the work happening. So, to answer your question: we are not working with them, the place of collaboration is futures-rs.
- ComputerGuru 7y agoI have heard that using the async-std APIs (but not the reactor and executor) causes background futures to be spawned to the async-std specific executor. I’m not sure of the veracity of this claim, can you comment?
- Argorak 7y ago
- Dowwie 7y agoWhy should it be resolved ASAP? This mentality that there should be no more than one viable solution to address a need is what needs resolving. Rust would not even exist if enough people agreed with that sentiment.