AI 中文总结
研究能否在普通OCaml 5内重构同步响应式编程核心机制,提出基于代数效果和深度处理程序的Tempo库运行时,通过效果操作界定暂停点、处理程序具体化延续为任务,比较研究量化其开销并确定主导成本的运行时机制。
AI 中文摘要
同步响应式编程通过将执行组织成逻辑瞬间和基于信号的通信,为响应式系统赋予确定性时间结构。Boussinot的同步响应式模型通过协作线程、广播信号和动态进程扩展了此设置;ReactiveML将该模型引入严格的、类型化的高阶函数式语言。本文研究能否在普通OCaml 5内部重构相同核心机制,而非通过专用语言扩展来暴露。我们展示了Tempo,一个基于代数效果和深度处理程序的库运行时:效果操作界定响应式暂停点,处理程序将捕获的延续作为按逻辑瞬间语义调度的任务具体化。与ReactiveML的比较研究量化了此库级重构的开销,并确定了主导其成本的运行时机制。
英文摘要
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.
Comments17 pages, 2 figures, 8 listings. Accepted at PPDP 2026; this is the submitted version