Reactive Programming with Reactive Variables
Reactive Programming enables declarative definitions of time-varying values (signals) and their dependencies in a way that changes are automatically propagated. In order to use reactive programming in an imperative object-oriented programming language, signals are usually modelled as objects. However, computations on primitive values then have to lifted to signals which usually involves a verbose notation. Moreover, it is important to avoid cycles in the dependency graph and glitches which can both result from changes to mutable global state during change propagation. This paper introduces reactive variables as extension to imperative languages. Changes to reactive variables are automatically propagated to other reactive variables but, in contrast to signals, reactive variables cannot be reified and used as values. Instead, references to reactive variables always denote their latest values. This enables computations without explicit lifting and limits the dependents of a reactive variable to the lexical scope of its declaration. The dependency graph is therefore by definition topologically ordered and acyclic. Additionally, reactive updates are prevented from mutating global state to ensure consistency. We present a working prototype implementation in JavaScript based on the sweet.js macro system and a formalism for integration with general imperative languages.
Tue 15 MarDisplayed time zone: Belfast change
08:30 - 10:00 | |||
08:30 30mDay opening | Arrival and Workshop Introduction CROW | ||
09:00 30mTalk | Reactive Object Queries CROW Stefan Lehmann Hasso-Plattner-Institute, Potsdam, Tim Felgentreff HPI, Germany, Jens Lincke Hasso Plattner Institute, Patrick Rein Hasso Plattner Institute, Robert Hirschfeld HPI | ||
09:30 30mTalk | Reactive Programming with Reactive Variables CROW |