Skip to content

bbvch/async-desugared

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Manual desugaring of async / await constructs in Rust

Introduction

Ever wondered, into what the compiler turns async / await constructs? This is the result of a live coding session performed during the Rust community meeting at bbv on 2026-04-23. It consists of the following parts:

src/bin/file-processor.rs

The original program which is about to be converted in 2 steps. It consists of a quite useless task of reading in 3 files, analyze their content and write the result of that analyze step into 3 output files. It has been generated using Claude Code.

src/bin/file-processor-step1.rs

First step after converting the async function read_file() into a manually desugared function. It mainly shows the transformation of such a function into a state-machine.

src/bin/file-processor-step2.rs

Second step by introducing a quite useless function which counts to 10. It shows what must be done when handling the poll call directly and also shows the importance of triggering the waker.

License

This project is licensed under the GNU General Public License v3.0.

See the LICENSE file for details, or visit GNU GPL v3.0.

What else?

The whole live coding session took about 0.75 to 1 hour. Depending on the collaboration of your audience.

Have fun!

About

Live coding session about desugaring async / await constructs in Rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors