Functional Reactive Programming (frp) extends traditional functional programming with dataflow evaluation, making it possible to write interactive programs in a declarative style. An frp language creates a dynamic graph of data dependencies and reacts to changes by propagating updates through the graph. In a transparent frp language, the primitive operators are implicitly lifted, so they construct graph nodes when they are applied to time-varying values. This model has some attractive properties, but it tends to produce a large graph that is costly to maintain. In this paper, we develop a transformation we call lowering, which improves performance by reducing the size of the graph. We present a static analysis that guides the sound application of this optimization, and we present benchmark results that demonstrate dramatic improvements in both speed and memory usage for real programs. Categories and Subject Descriptors D.3.2 [Programming Languages]: Language Classifications—data...
Kimberley Burchett, Gregory H. Cooper, Shriram Kri