Back
A design space exploration of async/await across seven runtimes
SiTech AI Team2 წთ. საკითხავი

A design space exploration of async/await across seven runtimes

Brown University's Cognitive Engineering Lab finds that seven modern async runtimes disagree even on a tiny program, and maps the nine design dimensions behind the divergence.

A new paper from Brown University's Cognitive Engineering Lab examines how async/await behaves across seven modern runtimes — and finds they agree far less than their shared syntax suggests. Gavin Gray published the post on September 8, 2026.

One small program, four answers

Languages have converged on "straight-line asynchrony" for more than fifteen years — making concurrent code look like ordinary linear code (Python, Rust, Swift). But a small pseudocode program shows the divergence: write_to_log prints "A", awaits a two-second sleep, then prints "B"; fire_and_forget spawns that function as a background task and returns without awaiting it; main awaits fire_and_forget, sleeps one second and prints "C". Seven runtimes — Asyncio, C#, JavaScript, Tokio, Smol, Trio and Swift — produce four different outputs, and across three variations of the program no two runtimes print the same thing.

Hot starts, cold starts and nine dimensions

Part of the explanation is "Eagerness": a hot start returns a task already running in the runtime, a cold start returns an inert object that does nothing until awaited, and Python and Rust evaluate lazily. The paper identifies nine such design dimensions — decisions that shape observable execution semantics rather than raw performance — grouped into Start of Life, End of Life and Cancellation.

Why Swift prints AC and Trio prints ABC

Two dimensions dominate the example. Under Dynamic Extent a task cannot outlive the function that spawned it — the choice made by Swift and by Python with Trio. They differ on Destruction: Swift cancels the orphaned task, while Trio politely waits for it to finish. Hence Swift prints "AC" and Trio "ABC". Cancellation varies further in awareness, persistence (a task may ignore cancellation and proceed, or remain cancelled) and how the signal propagates — top-down, bottom-up or simultaneously to all dependencies.

A calculus behind the design space

To make the space precise, the authors translated it into a formal semantics on a core calculus of asynchronous programs. Traces of the abstract machine highlight the semantic decisions that fork execution, explaining step by step why the programs diverge. Each dimension trades off performance, memory, ergonomics and semantics; there are no right answers and every language has its own rationale — but even tiny programs take serious work to explain.

SSiTech

SiTech — AI-powered web development

We build fast, modern websites and bring AI into real business workflows. Have a project or a question? We'd love to help.