一句话:系统梳理 straight-line asynchrony 的九维设计空间,揭示看似相同的 async/await 在语义上的分歧。
许多现代语言提供“直线式异步”(straight-line asynchrony),让异步函数形似同步函数,且普遍使用 async/await 等构造,容易让人以为语义相近。论文通过剖析多种现有语言,指出它们在影响执行是否存在与顺序的设计决策上各不相同,导致外观相似的程序产生不同行为。作者提出涵盖异步计算完整生命周期的九维设计空间,讨论调用异步函数有何保证、任务结束时的行为、任务如何应对取消等问题,并结合具体例子、非形式化设计讨论和形式语义加以阐释。目标不是判定某种设计优劣,而是帮助程序员、语言设计者和理论研究者理解该领域的设计选择与语义后果。
Many modern programming languages include some form of asynchronous programming. In particular, a growing number now have what we call straight-line asynchrony: attempts to provide asynchronous functions that look similar to synchronous functions, thereby enabling asynchrony without introducing complex control. These languages often share construct names like “async” and “await,” which suggests that they have deep semantic similarities. Yet, a close examination reveals that these languages are quite different along several dimensions, often subtly. These differences have real semantic consequences: similar-looking programs can exhibit divergent behavior, confusing developers and language designers alike. This paper therefore presents a design space exploration of straight-line asynchrony. We dissect several existing languages, and show how no two of them agree as a whole on design decisions that affect the presence and ordering of execution. We articulate a design space with nine dimensions covering the full lifecycle of an asynchronous computation, covering questions such as: What precise guarantees does a language give upon calling an asynchronous function? What happens at the end of a task’s life? How can a task handle being cancelled? We explore these questions through concrete examples, informal design discussion, and a formal semantics. Our ultimate goal is to help programmers, language designers, and language theorists all better understand the emerging landscape of straight-line asynchrony.
@article{paperbot12141,
title = {A Design Space Exploration of Async/Await},
author = {Gavin Gray and Shriram Krishnamurthi and Will Crichton},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {OOPSLA2},
year = {2026},
doi = {10.1145/3839519}
}