skip to main content
article
Free Access

Functional reactive programming from first principles

Authors Info & Claims
Published:01 May 2000Publication History
Skip Abstract Section

Abstract

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.

References

  1. 1 Tom M. Apostol. Mathematical Analysis A Modern Approach to Advanced Calculus. Addison-Wesley, 1957.]]Google ScholarGoogle Scholar
  2. 2 Gerard Berry. The Foundations of Esterel. MIT Press, 1998.]]Google ScholarGoogle Scholar
  3. 3 Gerard Berry. The constructive semantics of pure esteral (draft version 3). Draft Version 3, Ecole des Mines de Paris and INRIA, July 1999.]]Google ScholarGoogle Scholar
  4. 4 P. Caspi, N. Halbwachs, D. Pilaud, and J.A. Plaice. Lustre: A declarative language for programming synchronous systems. In 14th A CM Syrup. on Principles of Programming Languages, January 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 5 Conal Elliott. Modeling interactive 3D and multimedia animation with an embedded language. In Proceedings of the first conference on Domain-Specific Languages, pages 285-296. USENIX, October 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 6 Conal Elliott. Functional implementations of continuous modeled animation. In Proceedings of PLILP/ALP '93. Springer-Verlag, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7 Conal Elliott and Paul Hudak. Functional reactive animation. In International Conference on Functional Programming, pages 163-173, June 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8 Thierry Gautier, Paul Le Guernic, and Loic Besnard. Signal: A declarative language for synchronous programming of real-time systems. In Gilles Kahn, editor, Functional Programming Languages and Computer Architecture, volume 274 of Lect Notes in Computer Science edited by C. Coos and J. Hartmanis, pages 257-277. $pringer-Verlag, 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 9 Paul Hudak. Modular domain specific languages and tools. In Proceedings of Fifth International Conference on Software Reuse, pages 134-142. IEEE Computer Society, June 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10 Paul Hudak. The Haskell School of Expression - Learning Functional Programming through Multimedia. Cambridge University Press, New York, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11 Paul Hudak, Simon Peyton Jones, and Philip Wadler (editors). Report on the Programming Language Haskell, A Non-strict Purely Functional Language (Version 1.2). A CM SICPLAN Notices, 27(5), May 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12 Simon Peyton Jones, Andrew Gordon, and $igbjorn Finne. Concurrent Haskell. In A CM Symposium on the Principles of Programming Languages, St. Petersburg Beach, Florida, January 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 13 John Peterson, Gregory Hager, and Paul Hudak. A language for declarative robotic programming. In International Conference on Robotics and Automation, 1999.]]Google ScholarGoogle ScholarCross RefCross Ref
  14. 14 John Peterson, Paul Hudak, and Conal Elliott. Lambda in motion: Controlling robots with Haskell. In First International Workshop on Practical Aspects of Declarative Languages. $IGPLAN, Jan 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 15 John H. Reppy. CML: A higher-order concurrent language. Proceedings of the A CM SICPLAN 91 Conference on Programming Language Design and Implementation, pages 293-305, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. 16 W.W. Wadge and E.A. Ashcroft. Lucid the Dataflow Programming Language. Academic Press U.K., 1985.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Functional reactive programming from first principles

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 35, Issue 5
          May 2000
          357 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/358438
          Issue’s Table of Contents
          • cover image ACM Conferences
            PLDI '00: Proceedings of the ACM SIGPLAN 2000 conference on Programming language design and implementation
            August 2000
            358 pages
            ISBN:1581131992
            DOI:10.1145/349299

          Copyright © 2000 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 May 2000

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader