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.

Highlights

  • Elm is a functional reactive programming language that aims to simplify the creation of responsive graphical user interfaces (GUIs), and targets GUIs for web applications

  • Elm is a practical and expressive programming language, which we demonstrate through the implementation of an Elm compiler, and the use of the resulting compiler to develop rich, responsive GUIs that perform non-trivial computation

  • Elm embeds an implementation of discrete Arrowized Functional Reactive Programming (FRP) (AFRP), based on the naive continuation-based implementation described in the first AFRP paper [25]

Read more

Summary

Introduction

Elm is a functional reactive programming language that aims to simplify the creation of responsive graphical user interfaces (GUIs), and targets GUIs for web applications. Semantics of most FRP languages assume that signals change continuously. Their implementations sample input signals as quickly as possible, and continually recompute the program with the latest values for the signals. Elm is a practical and expressive programming language, which we demonstrate through the implementation of an Elm compiler, and the use of the resulting compiler to develop rich, responsive GUIs that perform non-trivial computation. Elm is strictly more expressive than these previous approaches, since (1) discrete signals generalize continuous signals [31], (2) we embed a discrete version of Arrowized FRP [25] in Elm, and (3) we allow the programmer to specify when signal updates should be computed asynchronously.

Elm through Examples
Core Language
Syntax
Type System
Semantics
Functional Evaluation
Signal Evaluation
Building GUIs with Elm
Elements and Forms
Reactive GUIs
Signal Functions
Implementation
Related Work
FRP GUI Frameworks
Conclusion

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.