4 ms·
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 use
by Dowwie 7y ago
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.
- Kaladin 7y agoIs there any resources you could point to learn more about how to use this async programming with?
- timvisee 7y agoYes this is amazing! And refactoring is actually quit easy to my experience, with two projects I've done this with at least.
- bluejekyll 7y agoI think it's straightforward, but it took me quite a while to do correctly in my dns project.
- Dowwie 7y agoAre there any lessons that would be useful for others to know about?
- bluejekyll 7y agoYes, I think so. I’ve been planning on writing a blog post.
- nirui 7y agoSo 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 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 :)
- nicoburns 7y agoThey'll probably be a while still as they're quite a complex feature. But they'll be useful for all sorts.