Semantics for graphical user interfaces

  • Authors:
  • Neelakantan R. Krishnaswami

  • Affiliations:
  • Max Planck Institute for Software Systems, Saarbruecken, Germany

  • Venue:
  • TLDI '12 Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementation
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Graphical user interface (GUI) libraries are one of the most widely-encountered higher-order interfaces. Even in languages (such as Java and C++) where programmers customarily avoid higher-order abstractions, the GUI toolkit interface is invariably higher-order. The foundation of these libraries is the callback: the display is conceptualized as something evolving over time, and programs register their interest in the changes the display undergoes by passing it functions to invoke whenever a given change happens. Alas, programs making heavy use of callbacks are notoriously dificult to write: they are all three of imperative, concurrent, and higher-order. There are design patterns (such as the model-view-controller pattern~[6])for writing such programs, but verification (and even specification!) of interactive programs written in this style remains very difficult. One attractive approach for taming this complexity has been functional reactive programming[5]. This model eliminates imperative state from the semantic model of interactive programs by treating time-varying values as first-class datatype, and eliminates concurrency by taking a synchronous view of time, thereby leaving us on the familiar ground of purely functional programming. Unfortunately, direct implementations of functional reactive programming tend to suffer from poor efficiency, arising from the mismatch between the mathematical abstraction of a stream and their realization in terms of mutable state. The typical response [7] has been to follow the example of synchronous dataflow languages [3, 12], and restrict the definable abstractions. This talk surveys a recent line of work [8-10] which fully supports the functional style (including full support for higher-order functions and higher-type streams), whilst still permitting efficient implementation. This work draws on a wide array of work ranging from metric-space approaches to denotational semantics [13, 14], step-indexing [1, 4], modal logic [11], to linear logic [2]. In the talk, we will also illustrate functional GUI programming with a series of examples in AdjS, a new programming language based on this model.