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.
- 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 ScholarDigital Library
- P. N. Benton and P. Wadler. Linear logic, monads and the lambda calculus. In LICS, pages 420--431, 1996. Google ScholarDigital Library
- G. Berry and L. Cosserat. The ESTEREL synchronous programming language and its mathematical semantics. In Seminar on Concurrency, pages 389--448. Springer, 1985. Google ScholarDigital Library
- L. Birkedal, R. E. Møgelberg, J. Schwinghammer, and K. Støvring. First steps in synthetic guarded domain theory: step-indexing in the topos of trees. In LICS, 2011. Google ScholarDigital Library
- C. Elliott and P. Hudak. Functional reactive animation. In ICFP, 1997. Google ScholarDigital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA, 1995. Google ScholarDigital Library
- 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 ScholarCross Ref
- N. R. Krishnaswami and N. Benton. A semantic model for graphical user interfaces. In ICFP, pages 45--57, 2011. Google ScholarDigital Library
- N. R. Krishnaswami and N. Benton. Ultrametric semantics of reactive programs. In LICS, pages 257--266. IEEE Computer Society, 2011. ISBN 978-0--7695--4412-0. Google ScholarDigital Library
- N. R. Krishnaswami, N. Benton, and J. Hoffmann. Higher-order functional reactive programming in bounded space. In POPL, 2012. Google ScholarDigital Library
- H. Nakano. A modality for recursion. In LICS, pages 255--266, 2000. Google ScholarDigital Library
- M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, 2006.Google Scholar
- J. J. M. M. Rutten. Elements of generalized ultrametric domain theory. Theor. Comput. Sci., 170 (1--2): 349--381, 1996. Google ScholarDigital Library
- J. Schwinghammer, L. Birkedal, and K. Støvring. A step-indexed kripke model of hidden state via recursive properties on recursively defined metric spaces. In M. Hofmann, editor, FOSSACS, volume 6604 of Lecture Notes in Computer Science, pages 305--319. Springer, 2011. ISBN 978--3--642--19804--5. Google ScholarDigital Library
Index Terms
- Semantics for graphical user interfaces
Recommendations
A semantic model for graphical user interfaces
ICFP '11We give a denotational model for graphical user interface (GUI) programming using the Cartesian closed category of ultrametric spaces. The ultrametric structure enforces causality restrictions on reactive systems and allows well-founded recursive ...
A semantic model for graphical user interfaces
ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programmingWe give a denotational model for graphical user interface (GUI) programming using the Cartesian closed category of ultrametric spaces. The ultrametric structure enforces causality restrictions on reactive systems and allows well-founded recursive ...
The decidability of the intensional fragment of classical linear logic
Intensional classical linear logic (MELL) is proved decidable.Intensional interlinear logic (RLL) is proved decidable.We adapt Kripke's method used to prove decidability for some relevance logics.The semi-relevant RLL emerges as a logic superior to MELL ...
Comments