Functional reactive programming from first principles

Authors
Citation
Zy. Wan et P. Hudak, Functional reactive programming from first principles, ACM SIGPL N, 35(5), 2000, pp. 242-252
Citations number
16
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
35
Issue
5
Year of publication
2000
Pages
242 - 252
Database
ISI
SICI code
1523-2867(200005)35:5<242:FRPFFP>2.0.ZU;2-E
Abstract
Functional Reactive Programming, or FRP. is a general framework for program ming hybrid systems in a high-level, declarative manner. The key ideas in F RP are its notions of behaviors and events. Behaviors are time-varying, rea ctive value while events are time-ordered sequences of discrete-time event occurrences. FRP is the essence of Fran, a domain-specific language embedde d in Haskell for programming reactive animations, but FRP is now also being used in vision, robotics and other control systems applications. In this paper we explore the formal semantics of FRP and how it relates to an implementation based on streams that represent (and therefore only appro ximate) continuous behaviors. We show that, in the limit as the sampling in terval goes to zero, the implementation is faithful to the formal, continuo us semantics, but only when certain constraints on behaviors are observed. We explore the nature of these constraints, which vary amongst the FRP prim itives. Our results show both the pou er and limitations of this approach t o language design and implementation. As an example of a limitation, we sho w that streams are incapable of representing instantaneous predicate events over behaviors.