arXiv:2610.12911cs.PLOct 2026

Manuscript Offprint

arXiv:2610.12911

Coexponential Exploration in the Clef Programming Language

Houston Haynes

Abstract

Clef was created as a concurrent programming language whose compiler tracks state ownership, waiting computations and request dependencies. We develop a coexponential account of stateful services and their client pools within this design. Delimited continuations retain the computation and resources needed to complete each interaction. These structures give our compiler premises for verifying service composition and preserving it through native lowering to multiple hardware targets.

We connect finite actor state transitions to the initial, service and final rules of a coexponential server. A separate operational account relates actor dispatch to single-use continuation frames. We prove state-ownership and reply preservation, give a finite communication-summary analysis, and derive circular-wait exclusion under stated assumptions. A further result identifies when changing service order preserves both state and replies.

Our Program Semantic Graph retains these facts through compilation. We are researching reusable proofs to confirm the ownership and communication interfaces, while our BAREWire implementation connects message meaning to its unboxed representation across respective endpoints. A distributed worker example preserves request identity across suspension, reordered replies and boundary conversion. Urschel's elimination-growth bounds supply quantitative premises for a solver service, whose accuracy and failure budget compose with the protocol contract.

Our two-category account connects component refinement, reusable proof terms and native realization. Protocols determine the admissible interactions, continuations expose their storage requirements, and retained dependencies support differential compilation. Developers can express ordinary stateful services while the compiler carries the conditions for their correct composition across execution targets.

1. Concurrent Composition in Clef

We design Clef around computations that can proceed independently, exchange values and wait reliably on explicitly represented dependencies. Our compiler retains the waiting invocation, the state and resources it owns, and the dependencies required for its resumption. These relationships give stateful services a common basis for checking ownership, communication and completion.

Consider a service that accepts a request, changes its private state and returns a result. Its input and output types can be correct even when the result reaches the wrong caller. The state can remain free of data races while two services wait indefinitely for one another. A timeout can release a caller while the remote request continues to change state. Each failure concerns a relationship between otherwise well-typed operations.

An actor makes several of these relationships visible. It owns state, receives messages through an interface and selects work according to an execution policy. A request that waits for another service also identifies a suspended computation. The values retained by that computation, its right to resume and the work it awaits belong to the same program structure. Our aim is to make that structure available to the compiler, together with the proofs that justify its use.

The practical lineage is familiar. Erlang developed process isolation, message passing and supervision into an engineering discipline for long-running services. Armstrong's account dates its development to 1986 [1]. In our Clef design, we connect those concerns to native compilation and automatic verification. A developer can use a stateful service through an ordinary library interface while the compiler retains the resource, protocol and dependency information needed to check its composition.

We organize the account around three questions. A message's data contract describes its values and representation. A session protocol describes the permitted conversation. A wait relation describes the work that must complete before another computation can continue. Our site's Three-Layer Actor Contract introduces this division. Here we give it a formal construction and connect it to the control operations that execute the conversation.

References (32)