skip to main content
research-article

Asynchronous functional reactive programming for GUIs

Published:16 June 2013Publication History
Skip Abstract Section

Abstract

Graphical user interfaces (GUIs) mediate many of our interactions with computers. Functional Reactive Programming (FRP) is a promising approach to GUI design, providing high-level, declarative, compositional abstractions to describe user interactions and time-dependent computations. We present Elm, a practical FRP language focused on easy creation of responsive GUIs. Elm has two major features: simple declarative support for Asynchronous FRP; and purely functional graphical layout.

Asynchronous FRP allows the programmer to specify when the global ordering of event processing can be violated, and thus enables efficient concurrent execution of FRP programs; long-running computation can be executed asynchronously and not adversely affect the responsiveness of the user interface.

Layout in Elm is achieved using a purely functional declarative framework that makes it simple to create and combine text, images, and video into rich multimedia displays.

Together, Elm's two major features simplify the complicated task of creating responsive and usable GUIs.

References

  1. U. A. Acar, G. E. Blelloch, and R. Harper. Adaptive functional programming. In Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 247--259, New York, NY, USA, 2002. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. U. A. Acar, A. Ahmed, and M. Blume. Imperative self-adjusting computation. In Proceedings of the 35th Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, pages 309--322, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. U. A. Acar, G. E. Blelloch, K. Tangwongsan, and D. Türkoğlu. Robust kinetic convex hulls in 3D. In Proceedings of the 16th Annual European Symposium on Algorithms, pages 29--40, Berlin, Heidelberg, 2008. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. H. Apfelmus. Reactive-banana. Haskell library available at http://www.haskell.org/haskellwiki/Reactive-banana, 2012.Google ScholarGoogle Scholar
  5. Z. M. Ariola and M. Felleisen. The call-by-need lambda calculus. Journal of Functional Programming, 7(3):265--301, May 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Chailloux, G. Cousineau, and A. Suàrez. MLgraph. http://www.pps.univ-paris-diderot.fr/~cousinea/MLgraph/mlgraph.html, 1992.Google ScholarGoogle Scholar
  7. G. H. Cooper. Integrating Dataflow Evaluation into a Practical Higher-Order Call-by-Value Language. PhD thesis, Brown University, May 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. Courtney. Frappé: Functional reactive programming in Java. In Proceedings of the Third International Symposium on Practical Aspects of Declarative Languages, pages 29--44, London, UK, 2001. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. A. Courtney and C. Elliott. Genuinely functional user interfaces. In Proceedings of the 2001 ACM SIGPLAN Workshop on Haskell, pages 41--69, 2001.Google ScholarGoogle Scholar
  10. A. Courtney, H. Nilsson, and J. Peterson. The Yampa arcade. In Proceedings of the 2003 ACM SIGPLAN Workshop on Haskell, pages 7--18, New York, NY, 2003. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Demers, T. Reps, and T. Teitelbaum. Incremental evaluation for attribute grammars with application to syntax-directed editors. In Proceedings of the 8th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 105--116, New York, NY, USA, 1981. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Elliott. Push-pull functional reactive programming. In Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell, pages 25--36, New York, NY, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. Elliott and P. Hudak. Functional reactive animation. In Proceedings of the 2nd ACM SIGPLAN International Conference on Functional Programming, pages 263--273, New York, NY, 1997. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. R. B. Findler and M. Flatt. Slideshow: functional presentations. In Proceedings of the Ninth ACM SIGPLAN International Conference on Functional Programming, pages 224--235, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Finne and S. Peyton Jones. Pictures: A simple structured graphics model. In Proceedings of the Glasgow Functional Programming Workshop, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. G. Giorgidze and H. Nilsson. Switched-on Yampa: declarative programming of modular synthesizers. In Proceedings of the 10th International Conference on Practical Aspects of Declarative Languages, pages 282--298, Berlin, Heidelberg, 2008. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. P. Henderson. Functional geometry. In Proceedings of the 1982 ACM Symposium on LISP and Functional Programming, pages 179--187, New York, NY, USA, 1982. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. D. Ignatoff, G. H. Cooper, and S. Krishnamurthi. Crossing state lines: Adapting object-oriented frameworks to functional reactive languages. In Proceedings of the International Symposium on Functional and Logic Programming, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. N. Kamin and D. Hyatt. A special-purpose language for picturedrawing. In Proceedings of the Conference on Domain-Specific Languages on Conference on Domain-Specific Languages (DSL), 1997, pages 23--23, Berkeley, CA, USA, 1997. USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. H. Liu and P. Hudak. Plugging a space leak with an arrow. Electron. Notes Theor. Comput. Sci., 193:29--45, Nov. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. H. Liu, E. Cheng, and P. Hudak. Causal commutative arrows and their optimization. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, pages 35--46, New York, NY, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. J. Maraist, M. Odersky, and P. Wadler. The call-by-need lambda calculus. Journal of Functional Programming, 8(3):275--317, May 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. L. A. Meyerovich, A. Guha, J. Baskin, G. H. Cooper, M. Greenberg, A. Bromfield, and S. Krishnamurthi. Flapjax: a programming language for Ajax applications. In Proceedings of the 24th ACM SIGPLAN Conference on Object Oriented Programming Systems Languages and Applications, pages 1--20, New York, NY, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. H. Nilsson. Dynamic optimization for functional reactive programming using generalized algebraic data types. In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming, pages 54--65, New York, NY, 2005. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell, pages 51--64, New York, NY, 2002. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Peterson, V. Trifonov, and A. Serjantov. Parallel functional reactive programming. In Proceedings of the Second International Workshop on Practical Aspects of Declarative Languages, pages 16--31, London, UK, 2000. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. J. H. Reppy. Concurrent programming in ML. Cambridge University Press, 1999. ISBN 9780521480895. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. Sage. FranTk - a declarative GUI language for Haskell. In Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming, pages 106--117, New York, NY, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. N. Sculthorpe and H. Nilsson. Safe functional reactive programming through dependent types. In Proceedings of the 14th ACM SIGPLAN International Conference on Functional Programming, pages 23--34, New York, NY, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Z. Wan, W. Taha, and P. Hudak. Real-time FRP. In Proceedings of the 6th ACM SIGPLAN International Conference on Functional Programming, pages 146--156, New York, NY, 2001. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Z. Wan, W. Taha, and P. Hudak. Event-driven FRP. In Proceedings of the 4th International Symposium on Practical Aspects of Declarative Languages, pages 155--172, London, UK, UK, 2002. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. D. N. Xu and S.-C. Khoo. Compiling real time functional reactive programming. In Proceedings of the ASIAN Symposium on Partial Evaluation and Semantics-Based Prog Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Asynchronous functional reactive programming for GUIs

      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

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 48, Issue 6
        PLDI '13
        June 2013
        515 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2499370
        Issue’s Table of Contents
        • cover image ACM Conferences
          PLDI '13: Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation
          June 2013
          546 pages
          ISBN:9781450320146
          DOI:10.1145/2491956

        Copyright © 2013 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: 16 June 2013

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader