Functional Reactive Programming
Paul Hudak · Lecture notes in computer science · 1999
Cited by 35Open access
Read the abstract, see who wrote it and who cites it, and get the citation in APA, MLA, Chicago or Harvard.
About 504 papers for “Functional reactive programming”
Paul Hudak · Lecture notes in computer science · 1999
Cited by 35Open access
Blackheath, Stephen, Jones, Anthony · 2016
Cited by 0
Guerric Chupin, Henrik Nilsson · Repository@Nottingham (University of Nottingham) · 2019
Functional Reactive Programming is an approach to declarative programming of reactive systems by describing interactions between time-varying values. FRP implementations are often realised as an embedding in a functional host language, making for very expressive reactive programming frameworks. However, this expressiveness comes at a cost: current embedded FRP implementations incur substantial performance overheads, in particular for values that (notionally) vary continuously. The basic idea of FRP is closely related to synchronous data-flow and continuous system simulation languages. In contrast to FRP, these handle values that vary continuously efficiently, but are less expressive. This paper seeks to bridge this gap by proposing a novel approach to embedded FRP-implementation that uses the fundamental implementation approach of synchronous datalow and simulation languages for efficient handling of continuously varying values, while retaining the expressiveness normally associated with FRP, as well as paying attention to values that only change relatively infrequently. These ideas are applicable beyond FRP, for example for implementing flexible embedded simulation languages. We evaluate our approach on a range of benchmarks, including an existing full-fledged video game where using our new FRP implementation as a drop-in replacement for the old one gave a three-fold performance improvement.
Cited by 17Open access
Ivan Pérez, Manuel Bärenz, Henrik Nilsson · 2016
Functional Reactive Programming (FRP) has come to mean many things. Yet, scratch the surface of the multitude of realisations, and there is great commonality between them. This paper investigates this commonality, turning it into a mathematically coherent and practical FRP realisation that allows us to express the functionality of many existing FRP systems and beyond by providing a minimal FRP core parameterised on a monad. We give proofs for our theoretical claims and we have verified the practical side by benchmarking a set of existing, non-trivial Yampa applications running on top of our new system with very good results.
Cited by 49
Finnbar Keating, Michael B. Gale · 2024
At present, the most efficient implementations of Arrowized Functional Reactive Programming (AFRP), such as Scalable FRP (SFRP), do not support the loop combinator. This prevents us from expressing fundamental programs in such implementations, which limits AFRP’s use in domains where both performance and expressivity are required. We introduce Oxbow, which extends SFRP with support for the loop combinator by leveraging an improved variant of the rearrange technique. In benchmarks, Oxbow performs at least 2.2x better than Yampa, an AFRP implementation that supports the loop combinator.
Cited by 1Open access
Atze van der Ploeg · Data Archiving and Networked Services (DANS) · 2013
Functional Reactive Programming (FRP) is a way to program reactive systems in functional style, eliminating many of the problems that arise from imperative techniques. In this paper, we present an alternative FRP formulation that is based on the notion of a reactive computation: a monadic computation which may require the occurrence of external events to continue. A signal computation is a reactive computation that may also emit values. In contrast to signals in other FRP formulations, signal computations can end, leading to a monadic interface for sequencing signal phases. This interface has several advantages: routing is implicit, sequencing signal phases is easier and more intuitive than when using the switching combinators found in other FRP approaches, and dynamic lists require much less boilerplate code. In other FRP approaches, either the entire FRP expression is re-evaluated on each external stimulus, or impure techniques are used to prevent redundant re-computations. We show how Monadic FRP can be implemented straightforwardly in a purely functional way while preventing redundant re-computations.
Cited by 16Open access
John Peterson, Ken Roe, Alan Cleary · 2015
Abstract. We present our experiences integrating Functional Reactive Programming (FRP) into a new host language, Python, and a variety of computational contexts: a game engine, a GUI system, and an em-bedded controller. We demonstrate FRP principles extended to a dy-namic environment and the integration of object-oriented libraries into the reactive environment. A number of FRP semantic issues are ad-dressed in a straight-forward way to produce an elegant combination of FRP and object-oriented programming. In particular, reactive proxies integrate traditional objects with the reactive world and event-triggered reactors allow reconfiguration of the network of reactive proxies and in-teraction with the outside world. This work demonstrates that FRP can serve as a unifying framework that simplifies programming and allows novices to build reactive systems. This system has been used to develop a wide variety of game programs and reactive animations in a summer camp which introduces programming concepts to teenagers. 1
Cited by 0
Keating, Finnbar · Warwick Research Archive Portal (University of Warwick) · 2024
Arrowised Functional Reactive Programming (AFRP) is a paradigm for writing programs which transform signals, or time-varying values. These are manipulated by signal functions to produce new signals. AFRP programs are represented declaratively as compositions of signal functions using the arrow combinators. Programs written using AFRP are susceptible to performance issues. The issue we focus on stems from Haskell implementations of AFRP taking advantage of lazy evaluation to evaluate loop expressions. These lazy semantics are used to identify the order in which signal functions within the body of the loop expression should be run. This introduces runtime overheads every time an input signal is updated. Our first approach to avoiding this performance issue is to transform loop bodies to forms with strict semantics. This program transformation uses Haskell’s arrow laws. We present an implementation, Severn, which allowed us to evaluate the performance impact of this transformation. However, this approach does not work well with the desugared code resulting from Haskell’s proc notation. We therefore present an alternative approach for routingheavy code akin to Scalable FRP (SFRP). This encodes signals as memory cells and signal functions as computations using those cells. Routing code is no longer necessary, as data is passed around via shared memory so does not need to be explicitly passed around. We present this alternative approach through our implementation, Oxbow. This encodes AFRP programs as computations using the rearrange technique, which augments the types of computations with information on which memory cells they read and write. This information is used to order computations at compile time so that a computation only runs once its inputs are up-to-date. xiii
Cited by 0Open access
Oswald Campesato · 2017
Cited by 0
2008
This report describes an implementation of a functional reactive programming extension to Java implemented using the feature-oriented Jakarta Tool Suite. I explore the connection between feature-oriented programming and domain specific languages by demonstrating how this domain-specific language is both implemented and used in a feature-oriented system. 1
Cited by 0
Titus H. Klinge, James I. Lathrop, Peter-Michael Osera et al. · Natural Computing · 2024
Cited by 1
Brevik, Mikael · TIB KMO / FLOWWORKS GmbH · 2014
Functional programming has been popular for quite some time, but now we're seeing that not only ninjas, but aso laymen is starting to use some of the functional paradigms. The same with Reactive programming. Reactive data is not only for blue collar spreadsheet experts or hardcore Verilog programmers. This talk will introduce the two paradigms combined as Functional Reactive Programming (FRP), first from a small theoretical perspective from its rise in the 90's. After the short theoretical introduction, we'll start live coding and showing practical examples of how we can use the FRP library Bacon.js to do functional reactive coding in the real world! We'll try to implement different examples live on stage, like using WebSockets or an auto complete search field. I will try to convince and show the attendees how incredible fun it is when using Bacon.js and how we can attain state-less code without asynchronus cludder.
Cited by 0Open access
Nicolas Modrzyk · Apress eBooks · 2017
We are finally coming to it. Functional reactive programming in the Web using Reagent. In the last chapter, we saw how smooth interaction with the host javascript platform was a key feature of ClojureScript. Reagent, a ClojureScript wrapper for Facebook React, brings another key feature in the ClojureScript ecosystem. Reagent also abstracts difficult concepts from React and brings its own version of reactive programming to you.
Cited by 0
Paul Hudak · ACM SIGSOFT Software Engineering Notes · 2000
No abstract available.
Cited by 6
Klinge, Titus H., Lathrop, James I., Osera, Peter-Michael et al. · DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · 2021
Chemical reaction networks (CRNs) are an important tool for molecular programming, a field that is rapidly expanding our ability to deploy computer programs into biological systems for a variety of applications. However, CRNs are also difficult to work with due to their massively parallel nature, leading to the need for higher-level languages that allow for easier computation with CRNs. Recently, research has been conducted into a variety of higher-level languages for deterministic CRNs but modeling CRN parallelism, managing error accumulation, and finding natural CRN representations are ongoing challenges. We introduce Reactamole, a higher-level language for deterministic CRNs that utilizes the functional reactive programming (FRP) paradigm to represent CRNs as a reactive dataflow network. Reactamole equates a CRN with a functional reactive program, implementing the key primitives of the FRP paradigm directly as CRNs. The functional nature of Reactamole makes reasoning about molecular programs easier, and its strong static typing allows us to ensure that a CRN is well-formed by virtue of being well-typed. In this paper, we describe the design of Reactamole and how we use CRNs to represent the common datatypes and operations found in FRP. We also demonstrate the potential of this functional reactive approach to molecular programming by giving an extended example where a CRN is constructed using FRP to modulate and demodulate an amplitude modulated signal.
Cited by 1Open access
Brigitte Pientka · 2013
No abstract available.
Cited by 0
Johan Nordlander · KTH Publication Database DiVA (KTH Royal Institute of Technology) · 1999
The construction of robust distributed and interactive software is still a challenging task, despite the recent popularity-increase for languages that take advanced programming concepts into the mainstream. Several problematic areas can be identified: most languages require the reactivity of a system to be manually upheld by careful avoidance of blocking operations; mathematical values often need to be encoded in terms of stateful objects or vice versa; concurrency is particularly tricky in conjunction with encapsulated software components; and static type safety is often compromised because of the lack of simultaneous support for both subtyping and polymorphism. This thesis presents a programming language, O'Haskell, that has been consciously designed with these considerations in mind. O'Haskell is defined by conservatively extending the purely functional language Haskell with the following features: A central structuring mechanism based on reactive objects, which unify the notions of objects and concurrent processes. Reactive objects are asynchronous, state-encapsulating servers whose purpose is to react to input messages; they cannot actively block execution or selectively filter their sources of input. A monadic layer of object-based computational effects, which clearly separates stateful objects from stateless values. Apart from higher-order functions and recursive data structures, the latter notion also includes first-class commands, object templates, and methods. A safe, polymorphic type system with declared record and datatype subtyping, supported by a powerful partial type inference algorithm. It is claimed that these features make O'Haskell especially well-adapted for the task of modern software construction. The thesis presents O'Haskell from both a practical and a theoretical perspective. The practical contributions are a full implementation of the language, a number of non-trivial programming examples that illustrate the merits of reactive objects in a realistic context, and several reusable programming methods for such applications as graphical user interfaces, embedded controllers, and network protocols. The theoretical results serve to substantiate the informal claim made regarding usability, and include a provably sound polymorphic subtyping system, soundness and partial completeness for the inference algorithm, a formal dynamic semantics, and a result that characterizes the conservative extension of a purely functional language with state and concurrency.
Cited by 39Open access
David Kraeutmann, Philip Kindermann, Rwth Aachen · 2015
Real-time programming is at its core quite imperative — read input, update state, write output, repeat. That requires you to describe what to do instead of what you want, which leads to a lot of boilerplate when just trying to model a state update. However, without additional thought even programs written using declarative programming lose their unique benefits due to the imperative style
Cited by 0
Paul Hudak, Antony Courtney, Henrik Nilsson et al. · 2002
Cited by 24
Evan Czaplicki, Stephen Chong · 2013
Graphical user interfaces (GUIs) mediate many of our interactions with computers. Functional Reactive Programming (FRP) is a promising approach to GUI design, providing high-level, declarative, compositional abstractions to describe user interactions and time-dependent computations. We present Elm, a practical FRP language focused on easy creation of responsive GUIs. Elm has two major features: simple declarative support for Asynchronous FRP; and purely functional graphical layout.
Cited by 162