Results 1 
4 of
4
Safe Functional Reactive Programming through Dependent Types
"... Functional Reactive Programming (FRP) is an approach to reactive programming where systems are structured as networks of functions operating on signals. FRP is based on the synchronous dataflow paradigm and supports both continuoustime and discretetime signals (hybrid systems). What sets FRP apart ..."
Abstract

Cited by 17 (0 self)
 Add to MetaCart
(Show Context)
Functional Reactive Programming (FRP) is an approach to reactive programming where systems are structured as networks of functions operating on signals. FRP is based on the synchronous dataflow paradigm and supports both continuoustime and discretetime signals (hybrid systems). What sets FRP apart from most other languages for similar applications is its support for systems with dynamic structure and for higherorder reactive constructs. Statically guaranteeing correctness properties of programs is an attractive proposition. This is true in particular for typical application domains for reactive programming such as embedded systems. To that end, many existing reactive languages have type systems or other static checks that guarantee domainspecific properties, such as feedback loops always being wellformed. However, they are limited in their capabilities to support dynamism and higherorder dataflow compared with FRP. Thus, the onus of ensuring such properties of FRP programs has so far been on the programmer as established static techniques do not suffice. In this paper, we show how dependent types allow this concern to be addressed. We present an implementation of FRP embedded in the dependentlytyped language Agda, leveraging the type system of the host language to craft a domainspecific (dependent) type system for FRP. The implementation constitutes a discrete, operational semantics of FRP, and as it passes the Agda type, coverage, and termination checks, we know the operational semantics is total, which means our type system is safe. Categories and Subject Descriptors D.3.2 [Programming Languages]: Language Classifications—applicative (functional) languages, dataflow languages, specialized application languages General Terms Languages Keywords dependent types, domainspecific languages, DSELs, FRP, functional programming, reactive programming, synchronous dataflow
TOWARDS SAFE AND EFFICIENT FUNCTIONAL REACTIVE PROGRAMMING
, 2011
"... Functional Reactive Programming (FRP) is an approach to reactive programming where systems are structured as networks of functions operating on timevarying values (signals). FRP is based on the synchronous dataflow paradigm and supports both continuoustime and discretetime signals (hybrid systems ..."
Abstract

Cited by 3 (0 self)
 Add to MetaCart
Functional Reactive Programming (FRP) is an approach to reactive programming where systems are structured as networks of functions operating on timevarying values (signals). FRP is based on the synchronous dataflow paradigm and supports both continuoustime and discretetime signals (hybrid systems). What sets FRP apart from most other reactive languages is its support for systems with highly dynamic structure (dynamism) and higherorder reactive constructs (higherorder dataflow). However, the price paid for these features has been the loss of the safety and performance guarantees provided by other, less expressive, reactive languages. Statically guaranteeing safety properties of programs is an attractive proposition. This is true in particular for typical application domains for reactive programming such as embedded systems. To that end, many existing reactive languages have type systems or other static checksthatguaranteedomainspecificconstraints, suchasfeedbackbeingwellformed(causality analysis). However, comparedwithFRP,theyarelimitedintheircapacitytosupportdynamism andhigherorderdataflow. Ontheotherhand, asestablishedstatictechniquesdonotsufficefor highly structurally dynamic systems, FRP generally enforces few domainspecific constraints, leaving the FRP programmer to manually check that the constraints are respected. Thus, there
TOWARDS SAFE AND EFFICIENT FUNCTIONAL REACTIVE PROGRAMMING
, 2011
"... Functional Reactive Programming (FRP) is an approach to reactive programming where systems are structured as networks of functions operating on timevarying values (signals). FRP is based on the synchronous dataflow paradigm and supports both continuoustime and discretetime signals (hybrid syste ..."
Abstract
 Add to MetaCart
(Show Context)
Functional Reactive Programming (FRP) is an approach to reactive programming where systems are structured as networks of functions operating on timevarying values (signals). FRP is based on the synchronous dataflow paradigm and supports both continuoustime and discretetime signals (hybrid systems). What sets FRP apart from most other reactive languages is its support for systems with highly dynamic structure (dynamism) and higherorder reactive constructs (higherorder dataflow). However, the price paid for these features has been the loss of the safety and performance guarantees provided by other, less expressive, reactive languages. Statically guaranteeing safety properties of programs is an attractive proposition. This is true in particular for typical application domains for reactive programming such as embedded systems. To that end, many existing reactive languages have type systems or other static checks that guarantee domainspecific constraints, such as feedback being wellformed (causality analysis). However, compared with FRP, they are limited in their capacity to support dynamism and higherorder dataflow. On the other hand, as established static techniques do not suffice for highly structurally dynamic systems, FRP generally enforces few domainspecific constraints, leaving the FRP programmer to manually check that the constraints are respected. Thus, there is currently a tradeoff between static guarantees and dynamism among reactive languages. This thesis contributes towards advancing the safety and efficiency of FRP by studying highly structurally dynamic networks of functions operating on mixed (yet distinct) continuoustime and discretetime signals. First, an ideal denotational semantics is defined for this kind of FRP, along with a type system that captures domainspecific constraints. The correctness and practicality of the language and type system are then demonstrated by proofofconcept implementations in Agda and Haskell. Finally, temporal properties of signals and of functions on signals are expressed using techniques from temporal logic, as motivation and justification for a range of optimisations. i
Causal commutative arrows
"... Arrows are a popular form of abstract computation. Being more general than monads, they are more broadly applicable, and, in particular, are a good abstraction for signal processing and dataflow computations. Most notably, arrows form the basis for a domainspecific language called Yampa, which has ..."
Abstract
 Add to MetaCart
Arrows are a popular form of abstract computation. Being more general than monads, they are more broadly applicable, and, in particular, are a good abstraction for signal processing and dataflow computations. Most notably, arrows form the basis for a domainspecific language called Yampa, which has been used in a variety of concrete applications, including animation, robotics, sound synthesis, control systems, and graphical user interfaces. Our primary interest is in better understanding the class of abstract computations captured by Yampa. Unfortunately, arrows are not concrete enough to do this with precision. To remedy this situation, we introduce the concept of commutative arrows that capture a noninterference property of concurrent computations. We also add an init operator that captures the causal nature of arrow effects, and identify its associated law. To study this class of computations in more detail, we define an extension to arrows called causal commutative arrows (CCA), and study its properties. Our key contribution is the identification of a normal form for CCA called causal commutative normal form (CCNF). By defining a normalization procedure, we have developed an optimization strategy that yields dramatic improvements in performance over conventional implementations of arrows. We have implemented this technique in Haskell, and conducted benchmarks that validate the effectiveness of our approach. When compiled with the Glasgow Haskell Compiler (GHC), the overall methodology can result in significant speedups. 1