Asynchronous Modal FRP

Over the past decade, a number of languages for functional reactive programming (FRP) have been suggested, which use modal types to ensure properties like causality, productivity and lack of space leaks. So far, almost all of these languages have included a modal operator for delay on a global clock. For some applications, however, the notion of global clock is unnatural and leads to leaky abstractions as well as inefficient implementations. While modal languages without a global clock have been proposed, no operational properties have been proved about them, yet. This paper proposes Async RaTT, a new modal language for asynchronous FRP, equipped with an operational semantics mapping complete programs to machines that take asynchronous input signals and produce output signals. The main novelty of Async RaTT is a new modality for asynchronous delay, allowing each output channel to be associated at runtime with the set of input channels it depends on, thus causing the machine to only compute new output when necessary. We prove a series of operational properties including causality, productivity and lack of space leaks. We also show that, although the set of input channels associated with an output channel can change during execution, upper bounds on these can be determined statically by the type system.

[1]  P. Bahr Modal FRP for all: Functional reactive programming without space leaks in Haskell , 2022, Journal of Functional Programming.

[2]  Thomas P. Hébert Patrick , 2021, Talented Young Men Overcoming Tough Times.

[3]  Neelakantan R. Krishnaswami,et al.  Adjoint Reactive GUI Programming , 2021, FoSSaCS.

[4]  Rasmus Ejlers Møgelberg,et al.  Diamonds are not forever: liveness in reactive programming with guarded recursion , 2020, Proc. ACM Program. Lang..

[5]  Rasmus Ejlers Møgelberg,et al.  Simply RaTT: a fitch-style modal calculus for reactive programming without space leaks , 2019, Proc. ACM Program. Lang..

[6]  Ivan Perez,et al.  Rhine: FRP with type-level clocks , 2018, Haskell@ICFP.

[7]  Bas Spitters,et al.  Modal dependent type theory and dependent right adjoints , 2018, Mathematical Structures in Computer Science.

[8]  Ranald Clouston,et al.  Fitch-Style Modal Lambda Calculi , 2017, FoSSaCS.

[9]  Koen Claessen,et al.  Practical principled FRP: forget the past, change the future, FRPNow! , 2015, ICFP.

[10]  Alan Jeffrey,et al.  Functional reactive types , 2014, CSL-LICS.

[11]  Prakash Panangaden,et al.  Fair reactive programming , 2014, POPL.

[12]  Neelakantan R. Krishnaswami,et al.  Higher-order functional reactive programming without spacetime leaks , 2013, ICFP.

[13]  Wolfgang Jeltsch,et al.  Towards a Common Categorical Semantics for Linear-Time Temporal Logic and Functional Reactive Programming , 2012, MFPS.

[14]  Nick Benton,et al.  Higher-order functional reactive programming in bounded space , 2012, POPL '12.

[15]  Alan Jeffrey,et al.  LTL types FRP: linear-time temporal logic propositions as types, proofs as functional reactive programs , 2012, PLPV '12.

[16]  Nick Benton,et al.  Ultrametric Semantics of Reactive Programs , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[17]  Conal Elliott,et al.  Push-pull functional reactive programming , 2009, Haskell.

[18]  Henrik Nilsson,et al.  Functional reactive programming, continued , 2002, Haskell '02.

[19]  Andrew W. Appel,et al.  An indexed model of recursive types for foundational proof-carrying code , 2001, TOPL.

[20]  Hiroshi Nakano,et al.  A modality for recursion , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[21]  Paul Hudak,et al.  Functional reactive animation , 1997, ICFP '97.

[22]  Nicolas Halbwachs,et al.  LUSTRE: a declarative language for real-time programming , 1987, POPL '87.

[23]  Robert H. Halstead,et al.  MULTILISP: a language for concurrent symbolic computation , 1985, TOPL.

[24]  Gérard Berry,et al.  The ESTEREL Synchronous Programming Language and its Mathematical Semantics , 1984, Seminar on Concurrency.

[25]  Marc Pouzet,et al.  Lucid Synchrone - version 2.0: Tutorial and reference manual , 2001 .

[26]  Frank Pfenning,et al.  A modal analysis of staged computation , 1996, POPL '96.

[27]  Fred Kröger,et al.  Temporal Logic of Programs , 1987, EATCS Monographs on Theoretical Computer Science.