Search papers, labs, and topics across Lattice.
This paper introduces Tempo, a library that reconstructs synchronous reactive programming within the OCaml 5 environment using algebraic effects and deep handlers. By allowing effect operations to define reactive suspension points and reifying continuations as tasks, Tempo achieves a novel implementation of Boussinot's synchronous reactive model without the need for a dedicated language extension. The comparative analysis with ReactiveML reveals the overhead associated with this library-level approach, pinpointing the primary runtime mechanisms responsible for performance costs.
Tempo shows that synchronous reactive programming can be effectively implemented in OCaml 5, challenging the necessity of dedicated language extensions. WHY_IT MATTERS: This work could significantly influence the design of reactive systems in functional programming, making them more accessible and flexible without sacrificing performance.
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.