skip to main content
10.1145/1244381.1244393acmconferencesArticle/Chapter ViewAbstractPublication PagespepmConference Proceedingsconference-collections
Article

Lowering: a static optimization technique for transparent functional reactivity

Published: 15 January 2007 Publication History

Abstract

Functional Reactive Programming (FRP) extends traditional functional programming with dataflow evaluation, making it possible to write interactive programs in a declarative style. An FRP language creates a dynamic graph of data dependencies and reacts to changes by propagating updates through the graph. In a transparent FRP language, the primitive operators are implicitly lifted, so they construct graph nodes when they are applied to time-varying values. This model has some attractive properties, but it tends to produce a large graph that is costly to maintain. In this paper, we develop a transformation we call lowering, which improves performance by reducing the size of the graph. We present a static analysis that guides the sound application of this optimization, and we present benchmark results that demonstrate dramatic improvements in both speed and memory usage for real programs.

References

[1]
The Flapjax programming language. http://flapjax-lang.org/.
[2]
A. Benveniste, P. L. Guernic, and C. Jacquemot. Synchronous programming with events and relations: the SIGNAL language and its semantics. Science of Computer Programming, 16(2):103--149, 1991.
[3]
G. Berry. The Foundations of Esterel. MIT Press, 1998.
[4]
P. Caspi, D. Pilaud, N. Halbwachs, and J. A. Plaice. LUSTRE: A declarative language for programming synchronous systems. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 178--188, 1987.
[5]
G. H. Cooper and S. Krishnamurthi. Embedding dynamic dataflow in a call-by-value language. In European Symposium on Programming, pages 294--308, 2006.
[6]
A. Courtney. Frappé: Functional reactive programming in Java. In Practical Aspects of Declarative Languages, pages 29--44. Springer-Verlag, March 2001.
[7]
R. K. Dybvig, R. Hieb, and C. Bruggeman. Syntactic abstraction in Scheme. Lisp and Symbolic Computation, 5(4):295--326, Dec. 1993.
[8]
C. Elliott and P. Hudak. Functional reactive animation. In ACM SIGPLAN International Conference on Functional Programming, pages 263--277, 1997.
[9]
R. B. Findler, J. Clements, C. Flanagan, M. Flatt, S. Krishnamurthi, P. Steckler, and M. Felleisen. DrScheme: A programming environment for Scheme. Journal of Functional Programming, 12(2):159--182, 2002.
[10]
R. B. Findler and M. Flatt. Slideshow: Functional presentations. In ACM SIGPLAN International Conference on Functional Programming, pages 224--235, 2004.
[11]
M. Flatt. Composable and compilable macros. In ACM SIGPLAN International Conference on Functional Programming, pages 72--83, 2002.
[12]
P. Hudak. The Haskell school of expression: learning functional programming through multimedia. Cambridge, 2000.
[13]
E. E. Kohlbecker, D. P. Friedman, M. Felleisen, and B. F. Duba. Hygienic macro expansion. In ACM Symposium on Lisp and Functional Programming, pages 151--161, 1986.
[14]
H. Nilsson. Dynamic optimization for functional reactive programming using generalized abstract data types. In ACM SIGPLAN International Conference on Functional Programming, pages 54--65, 2005.
[15]
H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In ACM SIGPLAN Workshop on Haskell, pages 51--64, 2002.
[16]
S. L. Peyton Jones. Compiling Haskell by transformation: a report from the trenches. In European Symposium on Programming, pages 18--44, 1996.
[17]
P. Wadler. Listlessness is better than laziness. In ACM Symposium on Lisp and Functional Programming, pages 45--52, 1986.
[18]
P. Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231--248, 1990.
[19]
P. Wadler. The essence of functional programming. In ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 1--14, January 1992.
[20]
Z. Wan and P. Hudak. Functional reactive programming from first principles. In ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 242--252, 2000.
[21]
Z. Wan, W. Taha, and P. Hudak. Real-time FRP. In ACM SIGPLAN International Conference on Functional Programming, pages 146--156, 2001.
[22]
Z. Wan, W. Taha, and P. Hudak. Event-driven FRP. In Practical Aspects of Declarative Languages, pages 155--172, 2002.

Cited By

View all
  • (2019)Reactive-based Complex Event ProcessingProceedings of the XXXIII Brazilian Symposium on Software Engineering10.1145/3350768.3352492(84-93)Online publication date: 23-Sep-2019
  • (2018)A domain-specific language for microservicesProceedings of the 9th ACM SIGPLAN International Symposium on Scala10.1145/3241653.3241654(2-12)Online publication date: 17-Sep-2018
  • (2018)On the Semantics of Distributed Reactive Programming: The Cost of ConsistencyIEEE Transactions on Software Engineering10.1109/TSE.2018.283310944:7(689-711)Online publication date: 1-Jul-2018
  • Show More Cited By

Index Terms

  1. Lowering: a static optimization technique for transparent functional reactivity

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    PEPM '07: Proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation
    January 2007
    180 pages
    ISBN:9781595936202
    DOI:10.1145/1244381
    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: 15 January 2007

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. FRP
    2. FrTime
    3. functional programming
    4. lifting
    5. lowering
    6. optimization
    7. reactive programming
    8. scheme
    9. static analysis

    Qualifiers

    • Article

    Conference

    PEPM07
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 66 of 120 submissions, 55%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)5
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 01 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2019)Reactive-based Complex Event ProcessingProceedings of the XXXIII Brazilian Symposium on Software Engineering10.1145/3350768.3352492(84-93)Online publication date: 23-Sep-2019
    • (2018)A domain-specific language for microservicesProceedings of the 9th ACM SIGPLAN International Symposium on Scala10.1145/3241653.3241654(2-12)Online publication date: 17-Sep-2018
    • (2018)On the Semantics of Distributed Reactive Programming: The Cost of ConsistencyIEEE Transactions on Software Engineering10.1109/TSE.2018.283310944:7(689-711)Online publication date: 1-Jul-2018
    • (2014)Distributed REScalaACM SIGPLAN Notices10.1145/2714064.266024049:10(361-376)Online publication date: 15-Oct-2014
    • (2014)Distributed REScalaProceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications10.1145/2660193.2660240(361-376)Online publication date: 15-Oct-2014
    • (2014)We have a DREAMProceedings of the 8th ACM International Conference on Distributed Event-Based Systems10.1145/2611286.2611290(142-153)Online publication date: 26-May-2014
    • (2014)A catalog of stream processing optimizationsACM Computing Surveys10.1145/252841246:4(1-34)Online publication date: 1-Mar-2014
    • (2014)Towards Reactive Programming for Object-Oriented ApplicationsTransactions on Aspect-Oriented Software Development XI10.1007/978-3-642-55099-7_7(227-261)Online publication date: 2014
    • (2013)Reactive behavior in object-oriented applicationsProceedings of the 12th annual international conference on Aspect-oriented software development10.1145/2451436.2451442(37-48)Online publication date: 24-Mar-2013
    • (2009)FlapjaxProceedings of the 24th ACM SIGPLAN conference on Object oriented programming systems languages and applications10.1145/1640089.1640091(1-20)Online publication date: 26-Oct-2009
    • 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

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media