🤖 AI Summary
This work presents the first purely library-based implementation of core synchronous reactive programming mechanisms in standard OCaml 5, without requiring any language extensions. Building upon algebraic effects and deep effect handlers, we introduce the Tempo runtime, which delineates reactive suspension points via effect operations and reifies captured continuations into tasks scheduled according to logical instant semantics. This approach supports cooperative threads, broadcast signals, and dynamic process creation while fully reproducing the core semantics of ReactiveML. Through empirical evaluation, we quantify the runtime overhead incurred by this library-level implementation and identify the key mechanisms responsible for the dominant performance costs.
📝 Abstract
Synchronous reactive programming gives reactive systems a deterministic temporal structure by organizing execution into logical instants and signal-based communication. Boussinot's synchronous reactive model extends this setting with cooperative threads, broadcast signals, and dynamic processes; ReactiveML brings that model into a strict, typed, higher-order functional language. This paper studies whether the same core mechanisms can be reconstructed inside ordinary OCaml 5, rather than exposed by a dedicated language extension. We present Tempo, a library runtime based on algebraic effects and deep handlers: effect operations delimit reactive suspension points, and the handler reifies captured continuations as tasks scheduled by logical-instant semantics. A comparative study with ReactiveML quantifies the overhead of this library-level reconstruction and identifies the runtime mechanisms that dominate its cost.