POPL 2027
Sun 10 - Sat 16 January 2027 Mexico City, Mexico

Choreographic programming is a programming paradigm for concurrent and distributed systems in which the behavior of the system is implemented as a global description called a choreography. The choreography is then projected into local programs by the compiler, which enables strong static guarantees about the behavior of the system such as deadlock freedom. Recent research has shifted towards a functional style of choreographic programming to allow writing higher-order choreographies for better modularity. However, it remains unclear how to support non-local control patterns, such as exception handling, in modern choreographic formalisms and implementations without breaking static guarantees such as deadlock freedom.

In this paper, we present ChorEff, a new choreographic language that supports effect handlers, a powerful abstraction that generalizes control flow constructs such as exceptions, continuations, and coroutines. Our key contribution is to identify and solve the problem of \textit{knowledge of control}: only the processes that raise an effect know that control has transferred, but the handler may involve other processes who must be informed. We integrate effect handlers into a core model for functional choreographies with a semilenient semantics, and prove that our language preserves modularity and deadlock freedom, and that every effect raised is handled. We also implement our language in OCaml, a functional language with native support for effect handlers, by leveraging PPX extensions to perform endpoint projection at compile time. We formalize our core language and proofs of key results in Lean.