← All projects
Project record1 mention
Originally shared on Hacker News

P4223: type-erased sender proposal for std::execution

A C++ standards proposal (P4223) for C++29 that extends std::execution with a type-erased sender, enabling separately compiled async algorithms just like sync functions, instead of senders fully encoding their computation shape in their type. The proposal envisions future language support for defining senders with imperative co_await code, opening the door to compiler-level async object lifetime analysis, optimization, and inlining of async functions. Next steps are writing P4223R1 to incorporate WG21 meeting feedback and exploring sender-attribute specification via key-value objects like receiver environments.

Last shared
01 / The problem

What it addresses

Senders as shipped in C++26 can really only express the async equivalent of inline functions because, except for task, all the standard senders fully encode the shape of their computation in their type.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. P4223: type-erased sender proposal for std::execution

    A C++ standards proposal (P4223) for C++29 that extends std::execution with a type-erased sender, enabling separately compiled async algorithms just like sync functions, instead of senders fully encoding their computation shape in their type. The proposal envisions future language support for defining senders with imperative co_await code, opening the door to compiler-level async object lifetime analysis, optimization, and inlining of async functions. Next steps are writing P4223R1 to incorporate WG21 meeting feedback and exploring sender-attribute specification via key-value objects like receiver environments.

    Problem: Senders as shipped in C++26 can really only express the async equivalent of inline functions because, except for task, all the standard senders fully encode the shape of their computation in their type.

    Posted by @ispeters · Original source ↗

    Source text · @ispeters · · Source ↗

    I'm working on a proposal for C++29 to extend `std::execution` by introducing a type-erased sender (P4223 https://wg21.link/p4223).