skip to main content
10.1145/2103656.2103665acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Higher-order functional reactive programming in bounded space

Published:25 January 2012Publication History

ABSTRACT

Functional reactive programming (FRP) is an elegant and successful approach to programming reactive systems declaratively. The high levels of abstraction and expressivity that make FRP attractive as a programming model do, however, often lead to programs whose resource usage is excessive and hard to predict. In this paper, we address the problem of space leaks in discrete-time functional reactive programs. We present a functional reactive programming language that statically bounds the size of the dataflow graph a reactive program creates, while still permitting use of higher-order functions and higher-type streams such as streams of streams. We achieve this with a novel linear type theory that both controls allocation and ensures that all recursive definitions are well-founded.

We also give a denotational semantics for our language by combining recent work on metric spaces for the interpretation of higher-order causal functions with length-space models of space-bounded computation. The resulting category is doubly closed and hence forms a model of the logic of bunched implications.

Skip Supplemental Material Section

Supplemental Material

popl_1b_1.mp4

mp4

192.5 MB

References

  1. U. A. Acar, G. E. Blelloch, R. Ley-Wild, K. Tangwongsan, and D. Türkoglu. Traceable data types for self-adjusting computation. In PLDI, pages 483--496, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. W. Appel, P.-A. Melliès, C. D. Richards, and J. Vouillon. A very modal model of a modern, major, general type system. In M. Hofmann and M. Felleisen, editors, POPL, pages 109--122. ACM, 2007. ISBN 1--59593--575--4. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. G. Berry and L. Cosserat. The ESTEREL synchronous programming language and its mathematical semantics. In Seminar on Concurrency, pages 389--448. Springer, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. P. Caspi, D. Pilaud, N. Halbwachs, and J. Plaice. LUSTRE: A declarative language for real-time programming. In POPL, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. G. Cooper. Integrating dataflow evaluation into a practical higher-order call-by-value language. PhD thesis, Brown University, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. G. Cooper and S. Krishnamurthi. Embedding dynamic dataflow in a call-by-value language. Programming Languages and Systems, pages 294--308, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Dreyer, A. Ahmed, and L. Birkedal. Logical step-indexed logical relations. In LICS, pages 71--80. IEEE, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. C. Elliott and P. Hudak. Functional reactive animation. In ICFP, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Hofmann. A type system for bounded space and functional in-place update. Nordic Journal of Computing, 7 (4), 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Hofmann. Linear types and non-size-increasing polynomial time computation. Information and Computation, 183 (1), 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. P. Hudak, A. Courtney, H. Nilsson, and J. Peterson. Arrows, robots and functional reactive programming. In Advanced Functional Programming, volume 2638 of LNCS. Springer, 2003.Google ScholarGoogle ScholarCross RefCross Ref
  12. J. Hughes. Generalizing monads to arrows. Sci. Comput. Program., 37 (1--3), 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. N. Krishnaswami and N. Benton. Ultrametric semantics of reactive programs. In LICS. IEEE, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. N. Krishnaswami and N. Benton. A semantic model of graphical user interfaces. In ICFP, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. U. D. Lago and M. Hofmann. Realizability models and implicit complexity. Theor. Comput. Sci., 412 (20): 2029--2047, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. Ley-Wild, U. A. Acar, and M. Fluet. A cost semantics for self-adjusting computation. In Z. Shao and B. C. Pierce, editors, POPL, pages 186--199. ACM, 2009. ISBN 978--1--60558--379--2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. H. Liu, E. Cheng, and P. Hudak. Causal commutative arrows and their optimization. In ICFP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. H. Nakano. A modality for recursion. In LICS, pages 255--266, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In ACM Haskell Workshop, pages 51--64. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. P. W. O'Hearn and D. J. Pym. The logic of bunched implications. Bulletin of Symbolic Logic, 5 (2), 1999.Google ScholarGoogle Scholar
  21. M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, 2006.Google ScholarGoogle Scholar
  22. N. Sculthorpe and H. Nilsson. Safe functional reactive programming through dependent types. In ICFP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Spoonhower, G. E. Blelloch, R. Harper, and P. B. Gibbons. Space profiling for parallel functional programs. In J. Hook and P. Thiemann, editors, ICFP, pages 253--264. ACM, 2008. ISBN 978--1--59593--919--7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. T. Uustalu and V. Vene. The essence of dataflow programming. In K. Yi, editor, APLAS, volume 3780 of Lecture Notes in Computer Science, pages 2--18. Springer, 2005. ISBN 3--540--29735--9. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Z. Wan, W. Taha, and P. Hudak. Real-time FRP. In ICFP, pages 146--156, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Z. Wan, W. Taha, and P. Hudak. Event-driven FRP. In PADL, pages 155--172, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Higher-order functional reactive programming in bounded space

    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
      POPL '12: Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
      January 2012
      602 pages
      ISBN:9781450310833
      DOI:10.1145/2103656
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 47, Issue 1
        POPL '12
        January 2012
        569 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2103621
        Issue’s Table of Contents

      Copyright © 2012 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: 25 January 2012

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate824of4,130submissions,20%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader