Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Someone needs to tell them about async Rust. Big yikes.


I'm a big Rust fan, but async Rust is an abomination.


I love async Rust. Its implementation is marvelous. Sueper plasant to write now that

* async closures

* async trait fns,

* `impl Trait` everywhere

are in place.


Maybe I should revisit async Rust. I haven't used that part of Rust in a while.


Wait up, are async closures in stable now?

Would certainly help with the wild return and type signatures I've had to write involving combinations of `Pin` `Box` & `Future<Output = Result<...>>`.

I think Rust futures are really awesome as they expose the lower level details of how async behavior works, giving the developer the flexibility to adapt it to their use case - but the standard library really dropped the ball on standardized usage/types.

For instance, can we please just have `AsyncRead` and `AsyncWrite` traits? Can they also be easy to implement (are just `async read()`)?

Right now you have to use adapters between Tokio types and the Futures crate and they both offer their own non-interoperable read/write traits.


It’ll be a nice day when AsyncRead/AsyncWrite lands in stable but I think we should appreciate that it didn’t happen hastily. Now that Linux has uring, Windows has IOCP etc we need to pass ownership of buffers to the kernel instead of passing by reference.

Edit: we use nightly Rust at work so I’m able to use async closures no problem but they’re not quite in stable just yet.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: