Higher-order functional reactive programming without spacetime leaks

  • Authors:
  • Neelakantan R. Krishnaswami

  • Affiliations:
  • Max Planck Institute for Software Systems (MPI-SWS), Saarbruecken, Germany

  • Venue:
  • Proceedings of the 18th ACM SIGPLAN international conference on Functional programming
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Functional reactive programming (FRP) is an elegant approach to declaratively specify reactive systems. However, the powerful abstractions of FRP have historically made it difficult to predict and control the resource usage of programs written in this style. In this paper, we give a new language for higher-order reactive programming. Our language generalizes and simplifies prior type systems for reactive programming, by supporting the use of streams of streams, first-class functions, and higher-order operations. We also support many temporal operations beyond streams, such as terminatable streams, events, and even resumptions with first-class schedulers. Furthermore, our language supports an efficient implementation strategy permitting us to eagerly deallocate old values and statically rule out spacetime leaks, a notorious source of inefficiency in reactive programs. Furthermore, these memory guarantees are achieved without the use of a complex substructural type discipline. We also show that our implementation strategy of eager deallocation is safe, by showing the soundness of our type system with a novel step-indexed Kripke logical relation.