Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/1596638.1596643acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Push-pull functional reactive programming

Published: 03 September 2009 Publication History

Abstract

Functional reactive programming (FRP) has simple and powerful semantics, but has resisted efficient implementation. In particular, most past implementations have used demand-driven sampling, which accommodates FRP's continuous time semantics and fits well with the nature of functional programming. Consequently, values are wastefully recomputed even when inputs don't change, and reaction latency can be as high as the sampling period. This paper presents a way to implement FRP that combines data- and demand-driven evaluation, in which values are recomputed only when necessary, and reactions are nearly instantaneous. The implementation is rooted in a new simple formulation of FRP and its semantics and so is easy to understand and reason about. On the road to a new implementation, we'll meet some old friends (monoids, functors, applicative functors, monads, morphisms, and improving values) and make some new friends (functional future values, reactive normal form, and concurrent "unambiguous choice").

Supplementary Material

JPG File (push-pullfunctionalreactiveprogrammingonvimeo.jpg)
MP4 File (push-pullfunctionalreactiveprogrammingonvimeo.mp4)

References

[1]
F. Warren Burton. Indeterminate behavior with determinate semantics in parallel programs. In International conference on Functional programming languages and computer architecture, pages 340--346. ACM, 1989.
[2]
F. Warren Burton. Encapsulating nondeterminacy in an abstract data type with deterministic semantics. Journal of Functional Programming, 1 (1): 3--20, January 1991.
[3]
Antony Courtney and Conal Elliott. Genuinely functional user interfaces. In Haskell Workshop, September 2001.
[4]
Conal Elliott. A brief introduction to ActiveVRML. Technical Report MSR-TR-96-05, Microsoft Research, 1996. URL http://conal.net/papers/ActiveVRML/.
[5]
Conal Elliott. Functional implementations of continuous modeled animation. In Proceedings of PLILP/ALP, 1998.
[6]
Conal Elliott. An imperative implementation of functional reactive animation. Unpublished draft, 1998. URL http://conal.net/papers/new-fran-draft.pdf.
[7]
Conal Elliott. Denotational design with type class morphisms. Technical Report 2009-01, LambdaPix, March 2009. URL http://conal.net/papers/type-class-morphisms.
[8]
Conal Elliott and Paul Hudak. Functional reactive animation. In International Conference on Functional Programming, 1997.
[9]
Saunders Mac Lane. Categories for the Working Mathematician. Graduate Texts in Mathematics. Springer, September 1998.
[10]
Conor McBride and Ross Paterson. Applicative programming with effects. Journal of Functional Programming, 18 (1): 1--13, 2008.
[11]
Henrik Nilsson. Dynamic optimization for functional reactive programming using generalized algebraic data types. In International conference on Functional programming, pages 54--65. ACM Press, 2005.
[12]
Henrik Nilsson, Antony Courtney, and John Peterson. Functional reactive programming, continued. In Haskell Workshop, pages 51--64. ACM Press, October 2002.
[13]
John Peterson, Paul Hudak, and Conal Elliott. Lambda in motion: Controlling robots with Haskell. In Practical Aspects of Declarative Languages, 1999.
[14]
John Peterson, Valery Trifonov, and Andrei Serjantov. Parallel functional reactive programming. Lecture Notes in Computer Science, 1753, 2000.
[15]
t al.(1996)Peyton Jones, Gordon, and Finne}PeytonJonesGordonFinne96:ConcurrentHaskellSimon Peyton Jones, Andrew Gordon, and Sigbjorn Finne. Concurrent Haskell. In Symposium on Principles of Programming Languages, January 1996.
[16]
Meurig Sage. FranTk -- a declarative GUI language for Haskell. In International Conference on Functional Programming, pages 106--118. ACM, ACM Press, September 2000.
[17]
Enno Scholz and Boris Bokowski. PIDGETS -- a C framework unifying postscript pictures, GUI objects, and lazy one-way constraints. In Conference on the Technology of Object-Oriented Languages and Systems. Prentice-Hall, 1996.
[18]
Michael Sperber. Computer-Assisted Lighting Design and Control. PhD thesis, University of Tübingen, June 2001.
[19]
Philip Wadler. Comprehending monads. In Conference on LISP and Functional Programming, pages 61--78. ACM, 1990.
[20]
Zhanyong Wan and Paul Hudak. Functional Reactive Programming from first principles. In Conference on Programming Language Design and Implementation, 2000.
[21]
Zhanyong Wan, Walid Taha, and Paul Hudak. Real-time FRP. In International Conference on Functional Programming, 2001.
[22]
Zhanyong Wan, Walid Taha, and Paul Hudak. Event-driven FRP. In Practical Aspects of Declarative Languages, January 2002.

Cited By

View all
  • (2024)Following the Writer’s Path to the Dynamically Coalescing Reactive Chains Design PatternAlgorithms10.3390/a1702005617:2(56)Online publication date: 25-Jan-2024
  • (2024)Functional Reactive Programming, RearrangedProceedings of the 17th ACM SIGPLAN International Haskell Symposium10.1145/3677999.3678278(55-67)Online publication date: 29-Aug-2024
  • (2024)Demo: A Geometric Approach to Generate Musical Rhythmic Patterns in HaskellProceedings of the 12th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design10.1145/3677996.3678295(50-54)Online publication date: 2-Sep-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
Haskell '09: Proceedings of the 2nd ACM SIGPLAN symposium on Haskell
September 2009
148 pages
ISBN:9781605585086
DOI:10.1145/1596638
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 03 September 2009

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. concurrency
  2. data-driven
  3. demand-driven
  4. functional reactive programming
  5. semantics

Qualifiers

  • Research-article

Conference

ICFP '09
Sponsor:

Acceptance Rates

Overall Acceptance Rate 57 of 143 submissions, 40%

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)38
  • Downloads (Last 6 weeks)3
Reflects downloads up to 13 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Following the Writer’s Path to the Dynamically Coalescing Reactive Chains Design PatternAlgorithms10.3390/a1702005617:2(56)Online publication date: 25-Jan-2024
  • (2024)Functional Reactive Programming, RearrangedProceedings of the 17th ACM SIGPLAN International Haskell Symposium10.1145/3677999.3678278(55-67)Online publication date: 29-Aug-2024
  • (2024)Demo: A Geometric Approach to Generate Musical Rhythmic Patterns in HaskellProceedings of the 12th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design10.1145/3677996.3678295(50-54)Online publication date: 2-Sep-2024
  • (2024)From Konnakol to Live CodingProceedings of the 12th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design10.1145/3677996.3678290(36-41)Online publication date: 2-Sep-2024
  • (2024)Reactamole: functional reactive molecular programmingNatural Computing10.1007/s11047-024-09982-523:3(477-495)Online publication date: 19-Apr-2024
  • (2023)Developing Distributed Systems with Multiparty Functional Reactive ProgrammingProceedings of the 2023 5th World Symposium on Software Engineering10.1145/3631991.3632000(61-66)Online publication date: 22-Sep-2023
  • (2023)This Is Driving Me Loopy: Efficient Loops in Arrowized Functional Reactive ProgramsProceedings of the 16th ACM SIGPLAN International Haskell Symposium10.1145/3609026.3609726(3-17)Online publication date: 30-Aug-2023
  • (2023)A Software Architecture Based on Coarse-Grained Self-Adjusting ComputationsProceedings of the 1st ACM SIGPLAN International Workshop on Functional Software Architecture10.1145/3609025.3609481(1-10)Online publication date: 30-Aug-2023
  • (2023)The Beauty and Elegance of Functional Reactive AnimationProceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design10.1145/3609023.3609806(8-20)Online publication date: 30-Aug-2023
  • (2023)Asynchronous Modal FRPProceedings of the ACM on Programming Languages10.1145/36078477:ICFP(476-510)Online publication date: 31-Aug-2023
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media