Refereed journal article or data article (A1)

Generating Reactive Programs for Graphical User Interfaces from Multi-way Dataflow Constraint Systems

List of Authors: Foust G, Järvi J, Parent S


Publication year: 2016

Journal: ACM sigplan notices

Journal name in source: ACM SIGPLAN NOTICES

Journal acronym: ACM SIGPLAN NOTICES

Volume number: 51

Issue number: 3

Number of pages: 10

ISSN: 0362-1340


For a GUI to remain responsive, it must be able to schedule lengthy tasks to be executed asynchronously. In the traditional approach to GUI implementation writing functions to handle individual user events asynchronous programming easily leads to defects. Ensuring that all data dependencies are respected is difficult when new events arrive while prior events are still being handled. Reactive programming techniques, gaining popularity in GUI programming, help since they make data dependencies explicit and enforce them automatically as variables' values change. However, data dependencies in GUIs usually change along with its state. Reactive programming must therefore describe a GUI as a collection of many reactive programs, whose interaction the programmer must explicitly coordinate. This paper presents a declarative approach for GUI programming that relieves the programmer from coordinating asynchronous computations. The approach is based on our prior work on "property models", where GUI state is maintained by a dataflow constraint system. A property model responds to user events by atomically constructing new data dependencies and scheduling asynchronous computations to enforce those dependencies. In essence, a property model dynamically generates a reactive program, adding to it as new events occur. The approach gives the following guarantee: the same sequence of events produces the same results, regardless of the timing of those events.

Last updated on 2021-24-06 at 10:28