Tail Modulo Async-Await
Abstract
This article extends tail-call optimisation by applying it to asynchronous calls. We first introduce TMA, a novel code transformation for asynchronous tail recursive functions that prevents the creation of unnecessary tasks. We then show how to combine TMA with the existing TMC optimisation; we obtain an optimisation able to turn a recursive function with multiple tail calls under constructors into a parallel version of the function, also optimised in space. We formalise both optimisations over representative calculi, and prove them correct through backward simulations. Finally, we provide a proof-of-concept implementation as an OCaml syntax extension and evaluate it experimentally, showing our approach optimises both memory and execution time
Fields of Study & Subjects
Logic
programming
and type systems
Parallel Computing and Optimization Techniques
Formal Methods in Verification
Publication details
- Journal / source
- Proceedings of the ACM on Programming Languages
- Volume
- 10
- Issue
- ICFP
- Pages
- 337–364
- Publication date
- 17 August 2026
- Language
- EN