Go to content

async fn from Editor to Executable - Arpad Borsos

An async fn that you write goes through different compiler stages, from Editor - AST - HIR - MIR - Executable. This process is complex and changing all the time. My contribution to this was removing the GenFuture type, which used to be an implementation detail of async Rust. I will give a deep dive into what this was, why it had to go, and the struggles from a contributor perspective in making it go away. A journey through different workarounds that existed temporarily, and are still existing today. Apart from this, I will also highlight some very common problems that developers may run into when developing async Rust. Why the difference between async fn and fn - impl Future matters a lot. Why the mem::size_of of Futures is currently a great concern, how to work around that, as well as an outlook on the Future (pun intended) when the compiler will improve and make manual workarounds unnecessary. 🦀 *About Arpad Borsos* 🦀 (https://swatinem.de/) Hi, I’m Arpad, and I go by Swatinem online. I work with (async) Rust day-to-day, writing critical processing infrastructure at Sentry. I’m also interested in improving Rust itself, where my focus has been on improving async Rust, and some work around code coverage.

October 10, 2023