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.