Abstract
Abstract
Functional reactive programming (FRP) provides a high-level interface for implementing reactive systems in a declarative manner. However, this high-level interface has to be carefully reigned in to ensure that programs can in fact be executed in practice. Specifically, one must ensure that FRP programs are causal and can be implemented without introducing space leaks. In recent years, modal types have been demonstrated to be an effective tool to ensure these operational properties. In this paper, we present
$\mathsf{Rattus}$
, a modal FRP language that extends and simplifies previous modal FRP calculi while still maintaining the operational guarantees for productivity, causality, and space leaks. The simplified type system makes
$\mathsf{Rattus}$
a practical programming language that can be integrated with existing functional programming languages. To demonstrate this, we have implemented a shallow embedding of
$\mathsf{Rattus}$
in Haskell that allows the programmer to write
$\mathsf{Rattus}$
code in familiar Haskell syntax and seamlessly integrate it with regular Haskell code. Thus,
$\mathsf{Rattus}$
combines the benefits enjoyed by FRP libraries such as Yampa, namely access to a rich library ecosystem (e.g., for graphics programming), with the strong operational guarantees offered by a bespoke type system. To establish the productivity, causality, and memory properties of the language, we prove type soundness using a logical relations argument fully mechanised in the Coq proof assistant.
Publisher
Cambridge University Press (CUP)
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Functional Reactive Programming, Rearranged;Proceedings of the 17th ACM SIGPLAN International Haskell Symposium;2024-08-28
2. This Is Driving Me Loopy: Efficient Loops in Arrowized Functional Reactive Programs;Proceedings of the 16th ACM SIGPLAN International Haskell Symposium;2023-08-30
3. Asynchronous Modal FRP;Proceedings of the ACM on Programming Languages;2023-08-30
4. Asynchronous Reactive Programming with Modal Types in Haskell;Lecture Notes in Computer Science;2023