Abstract
Functional reactive programming (FRP) is a paradigm for programming with signals and events, allowing the user to describe reactive programs on a high level of abstraction. For this to make sense, an FRP language must ensure that all programs are causal, and can be implemented without introducing space leaks and time leaks. To this end, some FRP languages do not give direct access to signals, but just to signal functions.
Recently, modal types have been suggested as an alternative approach to ensuring causality in FRP languages in the synchronous case, giving direct access to the signal and event abstractions. This paper presents Simply RaTT, a new modal calculus for reactive programming. Unlike prior calculi, Simply RaTT uses a Fitch-style approach to modal types, which simplifies the type system and makes programs more concise. Echoing a previous result by Krishnaswami for a different language, we devise an operational semantics that safely executes Simply RaTT programs without space leaks.
We also identify a source of time leaks present in other modal FRP languages: The unfolding of fixed points in delayed computations. The Fitch-style presentation allows an easy way to rules out these leaks, which appears not to be possible in the more traditional dual context approach.
Supplemental Material
- Andrew W. Appel and David McAllester. 2001. An Indexed Model of Recursive Types for Foundational Proof-carrying Code. ACM Trans. Program. Lang. Syst. 23, 5 (Sept. 2001), 657–683. Google Scholar
Digital Library
- Patrick Bahr, Hans Bugge Grathwohl, and Rasmus Ejlers Møgelberg. 2017. The clocks are ticking: No more delays!. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, June 20-23, 2017. IEEE Computer Society, Washington, DC, USA, 1–12. Google Scholar
Digital Library
- Andrew Barber. 1996. Dual intuitionistic linear logic. Technical Report. University of Edinburgh, Edinburgh, UK.Google Scholar
- Lars Birkedal, Rasmus Ejlers Møgelberg, Jan Schwinghammer, and Kristian Støvring. 2011. First steps in synthetic guarded domain theory: Step-indexing in the topos of trees. In In Proc. of LICS. IEEE Computer Society, Washington, DC, USA, 55–64. Google Scholar
Digital Library
- Paul Caspi, Daniel Pilaud, Nicolas Halbwachs, and John A. Plaice. 1987. LUSTRE: A Declarative Language for Real-time Programming. In Proceedings of the 14th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (POPL ’87). ACM, New York, NY, USA, 178–188. Google Scholar
Digital Library
- Andrew Cave, Francisco Ferreira, Prakash Panangaden, and Brigitte Pientka. 2014. Fair Reactive Programming. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’14). ACM, San Diego, California, USA, 361–372. Google Scholar
Digital Library
- Ranald Clouston. 2018. Fitch-style modal lambda calculi. In Foundations of Software Science and Computation Structures, Christel Baier and Ugo Dal Lago (Eds.), Vol. 10803. Springer, Springer International Publishing, Cham, 258–275.Google Scholar
- Ranald Clouston, Bassel Mannaa, Rasmus Ejlers Møgelberg, Andrew M. Pitts, and Bas Spitters. 2018. Modal Dependent Type Theory and Dependent Right Adjoints. CoRR abs/1804.05236 (2018), 1–21. arXiv: 1804.05236 http://arxiv.org/abs/ 1804.05236Google Scholar
- Conal Elliott and Paul Hudak. 1997. Functional Reactive Animation. In Proceedings of the Second ACM SIGPLAN International Conference on Functional Programming (ICFP ’97). ACM, New York, NY, USA, 263–273. Google Scholar
Digital Library
- Conal M. Elliott. 2009. Push-pull Functional Reactive Programming. In Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell (Haskell ’09). ACM, New York, NY, USA, 25–36. Google Scholar
Digital Library
- Pascal Raymond Erwan Jahier and Nicolas Halbwachs. 2019. The LUSTRE V6 Reference Manual. https://www- verimag. imag.fr/DIST- TOOLS/SYNCHRONE/lustre- v6/doc/lv6- ref- man.pdfGoogle Scholar
- Esterel Technologies SA. 2019a. Scientific Background. http://www.esterel- technologies.com/about- us/scientific- historicbackground/ .Google Scholar
- Esterel Technologies SA. 2019b. Success Stories. http://www.esterel- technologies.com/success- stories/ .Google Scholar
- Frederic Benton Fitch. 1952. Symbolic logic, an introduction. Ronald Press Co., New York, NY, USA.Google Scholar
- Adrien Guatto. 2018. A generalized modality for recursion. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science. ACM, 482–491. Google Scholar
Digital Library
- Alan Jeffrey. 2012. LTL types FRP: linear-time temporal logic propositions as types, proofs as functional reactive programs. In Proceedings of the sixth workshop on Programming Languages meets Program Verification, PLPV 2012, Philadelphia, PA, USA, January 24, 2012, Koen Claessen and Nikhil Swamy (Eds.). ACM, Philadelphia, PA, USA, 49–60. Google Scholar
Digital Library
- Alan Jeffrey. 2014. Functional Reactive Types. In Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS) (CSL-LICS ’14). ACM, New York, NY, USA, Article 54, 9 pages. Google Scholar
Digital Library
- Wolfgang Jeltsch. 2013. Temporal Logic with "Until", Functional Reactive Programming with Processes, and Concrete Process Categories. In Proceedings of the 7th Workshop on Programming Languages Meets Program Verification (PLPV ’13). ACM, New York, NY, USA, 69–78. Google Scholar
Digital Library
- Neelakantan R. Krishnaswami. 2013. Higher-order Functional Reactive Programming Without Spacetime Leaks. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming (ICFP ’13). ACM, Boston, Massachusetts, USA, 221–232. Google Scholar
Digital Library
- Neelakantan R. Krishnaswami and Nick Benton. 2011. Ultrametric Semantics of Reactive Programs. In 2011 IEEE 26th Annual Symposium on Logic in Computer Science. IEEE Computer Society, Washington, DC, USA, 257–266. Google Scholar
Digital Library
- Neelakantan R. Krishnaswami, Nick Benton, and Jan Hoffmann. 2012. Higher-order functional reactive programming in bounded space. In Proceedings of the 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, Philadelphia, Pennsylvania, USA, January 22-28, 2012, John Field and Michael Hicks (Eds.). ACM, Philadelphia, PA, USA, 45–58. Google Scholar
Digital Library
- Bassel Mannaa and Rasmus Ejlers Møgelberg. 2018. The Clocks They Are Adjunctions: Denotational Semantics for Clocked Type Theory. In 3rd International Conference on Formal Structures for Computation and Deduction, FSCD 2018, July 9-12, 2018, Oxford, UK (LIPIcs), Hélène Kirchner (Ed.), Vol. 108. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, New York, NY, USA, 23:1–23:17.Google Scholar
- Per Martin-Löf and Giovanni Sambin. 1984. Intuitionistic type theory. Vol. 9. Bibliopolis Naples, Napoli, IT.Google Scholar
- Conor McBride and Ross Paterson. 2008. Applicative programming with effects. Journal of functional programming 18, 1 (2008), 1–13. Google Scholar
Digital Library
- Hiroshi Nakano. 2000. A modality for recursion. In Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332). IEEE Computer Society, Washington, DC, USA, 255–266. Google Scholar
Digital Library
- Henrik Nilsson, Antony Courtney, and John Peterson. 2002. Functional Reactive Programming, Continued. In Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell (Haskell ’02). ACM, New York, NY, USA, 51–64. Google Scholar
Digital Library
- Amir Pnueli. 1977. The Temporal Logic of Programs. In Proceedings of the 18th Annual Symposium on Foundations of Computer Science. IEEE Computer Society, Washington, DC, USA, 46–57. Google Scholar
Digital Library
- Marc Pouzet. 2006. Lucid synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI 1 (2006), 25.Google Scholar
Index Terms
Simply RaTT: a fitch-style modal calculus for reactive programming without space leaks
Recommendations
Diamonds are not forever: liveness in reactive programming with guarded recursion
When designing languages for functional reactive programming (FRP) the main challenge is to provide the user with a simple, flexible interface for writing programs on a high level of abstraction while ensuring that all programs can be implemented ...
Higher-order functional reactive programming without spacetime leaks
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingFunctional 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 ...
Higher-order functional reactive programming without spacetime leaks
ICFP '13Functional 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 ...






Comments