News for hackers. Stuff that matters.
Re:Async-await on stable Rust by Dowwie on Thursday November 07, 2019 @10:30AM (#21474031)
This is a major milestone for Rust usability and developer productivity.

It was really hard to build asynchronous code until now. You had to clone objects used within futures. You had to chain asynchronous calls together. You had to bend over backwards to support conditional returns. Error messages weren't very explanatory. You had limited access to documentation and tutorials to figure everything out. It was a process of walking over hot coals before becoming productive with asynchronous Rust.

Now, the story is different. Further a few heroes of the community are actively writing more educational materials to make it even easier for newcomers to become productive with async programming much faster than it took others.

Refactoring legacy asynchronous code to async-await syntax offers improved readability, maintainability, functionality, and performance. It's totally worth the effort. Do your due diligence in advance, though, and ensure that your work is eligible for refactoring. Niko wasn't kidding about this being a minimum viable product.

Re:Async-await on stable Rust by Kaladin on Thursday November 07, 2019 @10:46AM (#21474186)
Is there any resources you could point to learn more about how to use this async programming with?
Re:Async-await on stable Rust by Dowwie on Thursday November 07, 2019 @10:56AM (#21474275)
Re:Async-await on stable Rust by larusso on Thursday November 07, 2019 @11:33AM (#21474674)
Thanks for the links. But they are not clickable :)
Re:Async-await on stable Rust by Dowwie on Thursday November 07, 2019 @11:37AM (#21474713)
done.
Re:Async-await on stable Rust by nirui on Friday November 08, 2019 @09:33AM (#21482469)
So I guess the Generic Associated Types should be the next then?

I was trying to refactor one of my Rust project the other day and almost immediately got hit by the "No async fn in traits" and the "No lifetime on Associated Type" truck. Then few days later, comes this article: https://news.ycombinator.com/item?id=21367691.

If GAT can resolve those two problems, then I guess I'll just add that to my wish list. Hope the Rust team keep up the awesome good work :)

Re:Async-await on stable Rust by nicoburns on Friday November 08, 2019 @10:37AM (#21483142)
They'll probably be a while still as they're quite a complex feature. But they'll be useful for all sorts.
Re:Async-await on stable Rust by timvisee on Thursday November 07, 2019 @11:54AM (#21474867)
Yes this is amazing! And refactoring is actually quit easy to my experience, with two projects I've done this with at least.
Re:Async-await on stable Rust by bluejekyll on Thursday November 07, 2019 @05:49PM (#21478120)
I think it's straightforward, but it took me quite a while to do correctly in my dns project.
Re:Async-await on stable Rust by Dowwie on Friday November 08, 2019 @09:11AM (#21482252)
Are there any lessons that would be useful for others to know about?
Re:Async-await on stable Rust by bluejekyll on Sunday November 10, 2019 @01:42PM (#21499435)
Yes, I think so. I’ve been planning on writing a blog post.