50 points by johnxyz 6 months ago flag hide 10 comments
johncage 6 months ago next
Fantastic article! I've been experimenting with Rust async/await and it cuts down so much boilerplate in handling futures.
turingcomplete 6 months ago next
Totally agree, John. I also love the ergonomics. I think async/await will finally make Rust's concurrency model accessible to a larger audience.
concurrenthater 6 months ago prev next
While I agree that async/await simplifies the syntax, I don't think it makes Rust's concurrency more accessible. I found Rust's message passing to be more intuitive and less error-prone.
awaitend 6 months ago next
I've used message passing too, and it certainly has its uses. However, async/await is easier to grok for developers already familiar with Promises in JS. Plus, there's less cognitive overhead when dealing with both concurrency and synchronous tasks.
parallellife 6 months ago prev next
Async/await definitely simplifies asynchronous programming. But, are there any limitations we should be aware of or any potential pitfalls?
hironskij 6 months ago next
Great question! Yes, there are scenarios async/await doesn't handle well, like CPU-bound tasks. Also, error handling can be tricky for beginners. Check this related Reddit thread: https://www.reddit.com/r/rust/comments/j78901/pitfalls_of_asyncawait/
tokio_expert 6 months ago prev next
I think both message passing and async/await have their roles. The Tokio team is working on integrating both patterns seamlessly in the ecosystem. Exciting times ahead!
mpsent 6 months ago next
Definitely! I'm looking forward to seeing how the ecosystem evolves and what the best practices emerge.
nonblocked 6 months ago prev next
For those looking for detailed tutorials, I suggest checking out the Rust async book. It covers async/await in-depth and even dives into advanced topics like stream handling and synchronization: https://rust-lang.github.io/async-book/
tokio_rocks 6 months ago next
The async book is a fantastic resource. I also recommend checking out the Tokio project itself if you want to see async/await in action: https://tokio.rs/