News for hackers. Stuff that matters.
Re:Why Async Rust? by troppl on Sunday October 15, 2023 @04:39PM (#37893201)
I have a question that maybe someone here knows. It has been noted multiple times in the comments here that at this point, one should just use tokio as the async runtime. (From my limited experience, I agree)

The async Rust book [0] says this about runtimes:

> Importantly, executors, tasks, reactors, combinators, and low-level I/O futures and traits are not yet provided in the standard library. In the meantime, community-provided async ecosystems fill in these gaps.

Notably, it says "not yet". My question is if someone knows if there are actual plans to incorporate any (existing) async runtime, and if so, whether there is a timeline? Also, is tokio in the talks to be the runtime, or is this still open?

[0]: https://rust-lang.github.io/async-book/08_ecosystem/00_chapt...

Re:Why Async Rust? by afdbcreid on Sunday October 15, 2023 @05:45PM (#37893672)
There are no plans to incorporate a big async runtime like tokio. This does not matches Rust's vision of small, well-focused std.

There are possible plans to implement a minimal runtime that only allows you to execute futures. No I/O or such. Mainly for tests or examples. No timeline though, at least as far as I'm aware.

There are also plans to standardize the async traits, e.g. spawn a new task, AsyncRead and AsyncWrite etc.. I don't think there is a timeline, but they wait at least for async fn in traits.

Re:Why Async Rust? by scottlamb on Sunday October 15, 2023 @07:49PM (#37894490)
> I don't think there is a timeline, but they wait at least for async fn in traits.

That was just merged! [1] It should be stable in 1.75 on December 28th.

[1] https://github.com/rust-lang/rust/pull/115822

Re:Why Async Rust? by afdbcreid on Sunday October 15, 2023 @09:21PM (#37894977)
I know it was merged, but currently there is only support for statically-dispatched async fn in traits. I believe we also need dynamic dispatch to compete with the current style of `poll_X()` functions in the I/O traits.
Re:Why Async Rust? by scottlamb on Sunday October 15, 2023 @10:43PM (#37895429)
Fair enough. I'm still excited!
Re:Why Async Rust? by bryanlarsen on Monday October 16, 2023 @11:08AM (#37900877)
The article proposes putting "pollster" or similar into the standard library.

https://docs.rs/pollster/latest/pollster/

Technically pollster is a runtime, although in practice it's an anti-runtime.