Tech Report CS-03-20

FrTime: Functional Reactive Programming in PLT Scheme

Gregory Cooper and Shriram Krishnamurthi

April 2004


Functional Reactive Programming (FRP) supports the declarative construction of reactive systems through signals, or time-varying values. In this paper, we present a new language called FrTime, which provides FRP-style signals atop a dialect of Scheme. We introduce the language with a few examples and discuss its implementation. Unlike previous FRP systems, FrTime uses impure features, such as state and asynchronous communication, to model time and to control evaluation. The use of such features yields a scalable, event-driven implementation with several important advantages. Specifically, it eases integration with other systems, supports distribution of signals across a network, and permits various benign impurities. To illustrate the language's expressive power, we present a concise implementation of a networked paddle-ball game in FrTime.

(complete text in pdf or gzipped postscript)