Less than two months after announcing Rust 1.38, the Rust team announced the release of Rust 1.39 yesterday. The new release brings the stable version of the async-await syntax, which will allow users to not only define async functions, but also block and .await them. The other improvements in Rust 1.39 include shared references to by-move bindings in match guards and attributes on function parameters.
The stable async function can be utilized (by writing async fn instead of fn) to return a Future when called. A Future is a suspended computation which is used to drive a function to conclusion “by .awaiting it.” Along with async fn, the async { … } and async move { … } blocks can also be used to define async literals.
According to Nicholas D. Matsakis, a member of the release team, the first stable support of async-await kicks-off the commencement of a “Minimum Viable Product (MVP)”, as the Rust team will now try to improve the syntax by polishing and extending it for future operations.
“With this stabilization, we hope to give important crates, libraries, and the ecosystem time to prepare for async /.await, which we’ll tell you more about in the future,” states the official Rust blog.
In the earlier versions, Rust would disallow taking shared references to by-move bindings in the if guards of match expressions. Starting from Rust 1.39, the compiler will allow binding in the following two ways-
The Rust team hopes that this feature will give developers a smoother and consistent experience with expressions.
Unlike the previous versions, Rust 1.39 will enable three types of attributes on parameters of functions, closures, and function pointers.
Many users are happy with the Rust 1.39 features and are especially excited about the stable version of async-await syntax.
A user on Hacker News comments, “Async/await lets you write non-blocking, single-threaded but highly interweaved firmware/apps in allocation-free, single-threaded environments (bare-metal programming without an OS). The abstractions around stack snapshots allow seamless coroutines and I believe will make rust pretty much the easiest low-level platform to develop for.”
Another comment read, “This is big! Turns out that syntactic support for asynchronous programming in Rust isn’t just syntactic: it enables the compiler to reason about the lifetimes in asynchronous code in a way that wasn’t possible to implement in libraries. The end result of having async/await syntax is that async code reads just like normal Rust, which definitely wasn’t the case before. This is a huge improvement in usability.”
Few have already upgraded to Rust 1.39 and shared their feedback on Twitter.
Check out the official announcement for more details. You can also read the blog on async-await for more information.
AWS will be sponsoring the Rust Project
Fastly announces the next-gen edge computing services available in private beta
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…