Higher-order functional reactive programming in bounded space

  • Authors:
  • Neelakantan R. Krishnaswami;Nick Benton;Jan Hoffmann

  • Affiliations:
  • Max Planck Institute for Software Systems, Saarbruecken, Germany;Microsoft Research, Cambridge, United Kingdom;Yale University, New Haven, CT, USA

  • Venue:
  • POPL '12 Proceedings of the 39th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Functional reactive programming (FRP) is an elegant and successful approach to programming reactive systems declaratively. The high levels of abstraction and expressivity that make FRP attractive as a programming model do, however, often lead to programs whose resource usage is excessive and hard to predict. In this paper, we address the problem of space leaks in discrete-time functional reactive programs. We present a functional reactive programming language that statically bounds the size of the dataflow graph a reactive program creates, while still permitting use of higher-order functions and higher-type streams such as streams of streams. We achieve this with a novel linear type theory that both controls allocation and ensures that all recursive definitions are well-founded. We also give a denotational semantics for our language by combining recent work on metric spaces for the interpretation of higher-order causal functions with length-space models of space-bounded computation. The resulting category is doubly closed and hence forms a model of the logic of bunched implications.