Asynchronous Reactive Programming with Modal Types in Haskell

Patrick Bahr, Emil Houlborg, Gregers Thomas Skat Rørdam

Research output: Conference Article in Proceeding or Book/Report chapterArticle in proceedingsResearchpeer-review

Abstract

The implementation of asynchronous systems, in particular graphical user interfaces, is traditionally based on an imperative model that uses shared mutable state and callbacks. While efficient, the combination of shared mutable state and callbacks is notoriously difficult to reason about and prone to errors. Functional reactive programming (FRP) provides an elegant alternative and recent theoretical advances in modal FRP suggest that it can be efficient as well.

In this paper, we present Async Rattus, an FRP language embedded in Haskell. The distinguishing feature of Async Rattus is a modal type constructor that enables the composition of asynchronous subsystems by keeping track of each subsystem’s clock at compile time which in turn enables dynamically changing clocks at runtime. The central component of our implementation is a Haskell compiler plugin that, among other aspects, checks the stricter typing rules of Async Rattus and infers compile-time clocks. This is the first implementation of an asynchronous modal FRP language. By embedding the language in Haskell we can exploit the existing language and library ecosystem as well as rapidly experiment with new language features and library design. We hope that such experimentation with Async Rattus sparks further research in modal FRP and its applications.
Original languageEnglish
Title of host publicationPractical Aspects of Declarative Languages
Volume14512
PublisherSpringer
Publication date10 Jan 2024
Pages18-36
DOIs
Publication statusPublished - 10 Jan 2024
Event26th International Symposium on Practical Aspects of Declarative Languages - London, United Kingdom
Duration: 15 Jan 202416 Jan 2024

Conference

Conference26th International Symposium on Practical Aspects of Declarative Languages
Country/TerritoryUnited Kingdom
CityLondon
Period15/01/202416/01/2024
SeriesLecture Notes in Computer Science
ISSN0302-9743

Keywords

  • Functional Reactive Programming
  • Modal Types
  • Type Systems
  • Haskell

Fingerprint

Dive into the research topics of 'Asynchronous Reactive Programming with Modal Types in Haskell'. Together they form a unique fingerprint.

Cite this