首页 /研究 /Functional reactive programming from first principles
OTHER

Functional reactive programming from first principles

Zhanyong Wan, Paul Hudak

发表年份
2000
引用次数
46

摘要

Functional Reactive Programming , or FRP , is a general framework for programming hybrid systems in a high-level, declarative manner. The key ideas in FRP are its notions of behaviors and events . Behaviors are time-varying, reactive values, while events are time-ordered sequences of discrete-time event occurrences. FRP is the essence of Fran , a domain-specific language embedded 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 approximate) continuous behaviors. We show that, in the limit as the sampling interval goes to zero, the implementation is faithful to the formal, continuous semantics, but only when certain constraints on behaviors are observed. We explore the nature of these constraints, which vary amongst the FRP primitives. Our results show both the power and limitations of this approach to language design and implementation. As an example of a limitation, we show that streams are incapable of representing instantaneous predicate events over behaviors.

关键词

Computer scienceHaskellFunctional reactive programmingProgramming languagePredicate (mathematical logic)Stream processingReactive programmingSemantics (computer science)Event (particle physics)Theoretical computer science

相关论文

查看 OTHER 分类全部论文