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.
- 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 ScholarDigital Library
- Gerard Berry. The constructive semantics of pure esteral (draft version 3). Draft Version 3, Ecole des Mines de Paris and lNRIA. July 1999.]]Google Scholar
- 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 ScholarDigital Library
- Paul Caspi and Marc Pouzet. Synchronous Kaliii networks. ACM SIGPLAN Notices, 31(6):226-238. 1996.]] Google ScholarDigital Library
- Antony Courtney. Frappe: Functional reactive programming in Java. In Proceedings of Symposium on Practical Aspects of Declarative Languages. ACM 2001.]] Google ScholarDigital Library
- Anthony C. Daniels. A Semantics for Functions and Behaviours. PhD thesis, The University of Nottingham, December 1999.]]Google Scholar
- Roberto Di Cosmo. isoniorphisms of Types: from A-calculus to information retrieval and language design. Progress in Theoretical Computer Science. Birkhauser, 1995.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- Conal Elliott and Paul Hudak. Functional reactive animation. In International Conference on Functional Programming, pages 163--173. June 1997.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- Thomas A. Henzinger. The theory of hybrid automata. Technical report, University of California. Berkeley, 1996.]]Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Paul Hudak. Building domain specific embedded languages. ACM Computing Surveys, 28A:(electronic). December 1996.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- Paul Hudak. The Haskell School of Expression -Learning Functional Programming through Multim.eil, a Cambridge University Press, New York, 2000.]] Google ScholarDigital Library
- John Hughes. Generalising monads to arrows. Scivone of Computer Programming, 37:67-111, May 2000.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Richard Kieburtz. Real-time reactive programming for embedded controllers. Available from author's home page, March 2001.]]Google Scholar
- Richard B. Kieburtz. Implementing closed domain-specific languages. In /361. pages 1-2, 2000.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- Alan Mycroft and Richard Sharp. A statically allocated parallel functional language. In Automata, Languages and Programming. pages 37-48, 2000.]] Google Scholar
- 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 Scholar
- John Peterson, Gregory Hager, and Paul Hudak. A language for declarative robotic programming. In International Conference on Robotics and Automation, 1999.]]Google ScholarCross Ref
- 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 ScholarDigital Library
- Gordon Plotkin. A structural approach to operational semantics. Technical report, Computer Science Department, Aarhns University, 1981.]]Google Scholar
- J. Rees and W. Clinger (eds.). The revised" report on the algorithmic language Scheme. SIGPLAN Notices, 21(12):37- 79, December 1986.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- David Sands. A nave time analysis and its theory of cost equivalence. Journal of Logic and Computation, 5(4):495-541, 1995.]]Google ScholarCross Ref
- Walid Taha. Multi-Stage Programming: Its Theory and Applications. PhD thesis, Oregon Graduate Institute of Science and Technology, 1999. Available from {26}.]] Google ScholarDigital Library
- Walid Taha, editor. Semantics, Applications, and Implementation of Program Generation, volume 1924 of Lecture Notes in Computer Science, Montral. 2000. Springer-Verlag.]] Google ScholarDigital Library
- 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 ScholarDigital Library
- W.W. Wadge and E.A. Ashcroft. Lucid, the Dataflow Programming Language. Academic Press U.K., 1985.]] Google ScholarDigital Library
- Zhanyong Wan and Paul Hudak. Functional reactive programming from first principles. In Proceedings of Symposium on Programming Language Design and Implementation. ACM, 2000.]] Google ScholarDigital Library
Index Terms
- Real-time FRP
Recommendations
Real-time FRP
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 ...
Event-Driven FRP
PADL '02: Proceedings of the 4th International Symposium on Practical Aspects of Declarative LanguagesFunctional Reactive Programming (FRP) is a high-level declarative language for programming reactive systems. Previous work on FRP has demonstrated its utility in a wide range of application domains, including animation, graphical user interfaces, and ...
Compiling real time functional reactive programming
ASIA-PEPM '02: Proceedings of the ASIAN symposium on Partial evaluation and semantics-based program manipulationMost of the past languages for reactive systems are based on synchronous dataflow. Recently, a new reactive language, called Real-Time Functional Reactive Programming (RT-FRP) [18] , has been proposed based on the functional paradigm. The unique feature ...
Comments