Tempo: Reconstructing Synchronous Reactive Programming with OCaml 5 Effects
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.