skip to main content
10.1145/507635.507654acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
Article

Real-time FRP

Published:01 October 2001Publication History

ABSTRACT

Functional reactive programming (FRP) is a declarative programming paradigm where the basic notions are continuous, time-varying behaviors and discrete, event-based reactivity. FRP has been used successfully in many reactive programming domains such as animation, robotics, and graphical user interfaces. The success of FRP in these domains encourages us to consider its use in real-time applications, where it is crucial that the cost of running a program be bounded and known before run-time. But previous work on the semantics and implementation of FRP was not explicitly concerned about the issues of cost. In fact, the resource consumption of FRP programs in the current implementation is often hard to predict. As a first step towards addressing these concerns, this paper presents real-time FRP (RT-FRP), a statically-typed language where the time and space cost of each execution step for a given program is statically bounded. To take advantage of existing work on languages with bounded resources, we split RT-FRP into two parts: a reactive part that captures the essential ingredients of FRP programs, and a base language part that can be instantiated to any generic programming language that has been shown to be terminating and resource-bounded. This allows us to focus on the issues specific to RT-FRP, namely, two forms of recursion. After presenting the operational explanation of what can go wrong due to the presence of recursion, we show how the typed version of the language is terminating and resource-bounded. Most of our FRP programs are expressible directly in RT. The rest are expressible via a simple mechanism that integrates RT-FRP with the base language.

References

  1. G. Berry and L. Cosserat. The esterel synchronous programming language and its mathematical semantics. In AW. Roscoe S.D. Brookes and editors C. Winskel, editors, Seminar on Concurrency, volume 197 of Lect. Notes in Computer Science, pages 389--448. Springer Verlag, 1985.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Gerard Berry. The constructive semantics of pure esteral (draft version 3). Draft Version 3, Ecole des Mines de Paris and lNRIA. July 1999.]]Google ScholarGoogle Scholar
  3. P. Caspi, N. Halbwachs, D. Pilaud, and J. A. Plaice. Lustre: A declarative language for programming synchronous systems. In 14th A CAI Symp. on Principles of Programming Languages. January I]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Paul Caspi and Marc Pouzet. Synchronous Kaliii networks. ACM SIGPLAN Notices, 31(6):226-238. 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Antony Courtney. Frappe: Functional reactive programming in Java. In Proceedings of Symposium on Practical Aspects of Declarative Languages. ACM 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Anthony C. Daniels. A Semantics for Functions and Behaviours. PhD thesis, The University of Nottingham, December 1999.]]Google ScholarGoogle Scholar
  7. Roberto Di Cosmo. isoniorphisms of Types: from A-calculus to information retrieval and language design. Progress in Theoretical Computer Science. Birkhauser, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Conal Elliott. Modeling interactive 3D and multimedia animation with an embedded language In Proceedings of the first conference on Domain-81)((41, Languages, pages 285-296. USENIX, October 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Conal Elliott and Paul Hudak. Functional reactive animation. In International Conference on Functional Programming, pages 163--173. June 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 a-nd Computer Architecture, volume 274 of Lect Not .5 iii Computer Science, edited by C. Coos and I. Hartmanis, pages 257-277. Springer-Verlag, 1987.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Thomas A. Henzinger. The theory of hybrid automata. Technical report, University of California. Berkeley, 1996.]]Google ScholarGoogle Scholar
  12. Martin Hofmann. A type system for bounded space and functional in-place update. In European Symposium. on Programming (ESOP), Lecture Notes in Computer Science. Springer-Verlag, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. P. Hudak, S. Peyton Jones, and P. Wadler (editors). Report on the Programming Language Haskell, A Non-strict Purely Functional Language (Version 1.2). ACM SIGPLAN Notices. 27(5), May 1992.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Paul Hudak. Building domain specific embedded languages. ACM Computing Surveys, 28A:(electronic). December 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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
  16. Paul Hudak. The Haskell School of Expression -Learning Functional Programming through Multim.eil, a Cambridge University Press, New York, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. John Hughes. Generalising monads to arrows. Scivone of Computer Programming, 37:67-111, May 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. John Hughes and Lars Pareto. Recursion and dynamo data-structures in bounded space: Towards embedded NIL programming. In Proceedings of the Fourth AC-11 SIGPLAN International Conference on Functional Programming (ICPP-99), volume 34.9 of ACM Sigplan Notices, pages 7081, N.Y., September 27-29 1999. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. John Hughes, Lars Pareto, and Amr Sabry. Proving the correctness of reactive systems using sized types. In Guy L. Steele Jr, editor, In proceedings of the ACM Symposium on Principles of Programming Languages (POPL), volume 23. St Petersburg, Florida, 1996. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Richard Kieburtz. Real-time reactive programming for embedded controllers. Available from author's home page, March 2001.]]Google ScholarGoogle Scholar
  21. Richard B. Kieburtz. Implementing closed domain-specific languages. In /361. pages 1-2, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 0. (Oded) Maler, editor. Hybrid and real-time systems: international workshop, HART '97, Grenoble, France, March 26-28. 1997: proceedings, volume 1201 of Lecture Notes in Computer Science, New York, NY, USA, 1997. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Eugenio Moggi, Walid Taha, Zinc El-Abidine Benaissa, and Tim Sheard. An idealized MetaML: Simpler, and more expressive. In European Symposium on Programming (ESOP), volume 1576 of Lecture Notes in Computer Science, pages 193-207. Springer-Verlag, 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. A. S. Murawski and C.-H. L. Ong. Can safe recursion be interpreted in light logic? In Second International Workshop on Implicit Computational Complexity, Santa Barbara, June 200.]]Google ScholarGoogle Scholar
  25. Alan Mycroft and Richard Sharp. A statically allocated parallel functional language. In Automata, Languages and Programming. pages 37-48, 2000.]] Google ScholarGoogle Scholar
  26. Oregon Graduate Institute Technical Reports. P.O. Box 91000, Portland, OR 97291 1000.USA. Available online from ftp://cse.ogi.edu/pub/tech-reports/README,html. Last viewed August 1999.]]Google ScholarGoogle Scholar
  27. 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
  28. John Peterson, Paul Hudak, and Conal Elliott. Lambda in motion: Controlling robots with haskell. In First International Workshop on Practical Aspects of Declarative Languages. SIGPLAN, Jan 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Gordon Plotkin. A structural approach to operational semantics. Technical report, Computer Science Department, Aarhns University, 1981.]]Google ScholarGoogle Scholar
  30. J. Rees and W. Clinger (eds.). The revised" report on the algorithmic language Scheme. SIGPLAN Notices, 21(12):37- 79, December 1986.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Alastair Reid, John Peterson, Greg Hager, and Paul Hudak. Prototyping real-time vision systems: An experiment in DSL design. In Proc. Int'l Conference on Software Engineering, May 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. John H. Reppy. CML: A higher-order concurrent language. Proceedings of the ACM SICPLAN '91 Conference on Programming Language Design and Implementation, pages 293305, 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Meurig Sage. FranTk - a declarative GUI language for Haskell. In Proceedings of Fifth ACM SIGPLAN International Conference on Functional Programming, pages 106-118, Montreal, Canada, September 2000. ACM.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. David Sands. A nave time analysis and its theory of cost equivalence. Journal of Logic and Computation, 5(4):495-541, 1995.]]Google ScholarGoogle ScholarCross RefCross Ref
  35. Walid Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, 1999. Available from {26}.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Walid Taha, editor. Semantics, Applications, and Implementation of Program Generation, volume 1924 of Lecture Notes in Computer Science, Montral. 2000. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Walid Taha, Zinc-El-Abidine Benaissa, and Tim Sheard. Multi-stage programming: Axiomatization and type-safety. In 25th International Colloquium on Automata, Languages, and Programming (ICALP), volume 1443 of Lecture Notes in Computer Science, pages 918 929, Aalborg. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. W.W. Wadge and E.A. Ashcroft. Lucid, the Dataflow Programming Language. Academic Press U.K., 1985.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Zhanyong Wan and Paul Hudak. Functional reactive programming from first principles. In Proceedings of Symposium on Programming Language Design and Implementation. ACM, 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Real-time FRP

        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
        • Published in

          cover image ACM Conferences
          ICFP '01: Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
          October 2001
          277 pages
          ISBN:1581134150
          DOI:10.1145/507635
          • cover image ACM SIGPLAN Notices
            ACM SIGPLAN Notices  Volume 36, Issue 10
            October 2001
            276 pages
            ISSN:0362-1340
            EISSN:1558-1160
            DOI:10.1145/507669
            Issue’s Table of Contents

          Copyright © 2001 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 October 2001

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • Article

          Acceptance Rates

          ICFP '01 Paper Acceptance Rate23of66submissions,35%Overall Acceptance Rate333of1,064submissions,31%

          Upcoming Conference

          ICFP '24

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader