A Design Space Exploration of Async/Await(cel.cs.brown.edu)
383 points by wcrichton 3 days ago | 110 comments
tl;dr: Async/await semantics vary wildly across languages: a simple fire-and-forget program produces four different outputs across seven runtimes (Asyncio, C#, JavaScript, Tokio, Smol, Trio, Swift), with no two runtimes agreeing on three variations of the program. The authors' paper identifies nine design dimensions (e.g., Eagerness, Extent, Destruction, Cancellation behavior) that explain the divergence, and formalizes them in a core calculus that traces exactly which design choices lead to which observable behaviors.
HN Discussion:
  • Appreciation for the semantics-first comparative analysis approach to understanding languages
  • Surprise and validation that async has many more design dimensions than commonly realized
  • Practical value for language designers making these decisions themselves
  • ~The framework/quiz is too rigid and ignores that some runtimes offer configurable options
  • ~Article is incomplete because it omits stackful coroutines like Lua's