Object-Oriented Reactive Programming: A Reflective Approach

Scriptie/masterproef: Master's Thesis


The massive adoption of mobile devices, such as smart phones and tablets has
given rise to an increasing number of event-driven applications that run on these
mobile devices. Such applications have to deal with a plethora of events, e.g.
originating from the GPS sensor, accelerometer, network events. Currently, eventbased
programming languages are often used to develop reactive applications but
this implies inversion of control and often leads to callback hell. The reactive
programming paradigm is a paradigm that is generally accepted as well suited
for the development of event-driven and interactive applications. This paradigm
introduces abstractions that allow developers to define time-varying values and it
automatically tracks dependencies between such time-varying values. In reactive
programming, developers express reactive programs in terms of what to do. The
language is responsible to decide when to do it.
Various approaches to functional reactive programming have already been embedded
in various languages such as Scheme, JavaScript and Haskell. Since they
are functional languages, adopting them in imperative languages requires manual
glue code between the functional reactive code and the imperative, possibly
object-oriented code. Such languages also do not fit well with mutable objects.
Because of this, programmers often use traditional non-reactive solutions such
as the observer pattern to implement reactive applications. They bear with such
error-prone solutions so that they can still enjoy the benefits of object-oriented
In this thesis we present reAcT. reAcT is a variant of the AmbientTalk language
which unifies reactive programming and the underlying object-oriented model.
reAcT introduces a novel reactive abstraction called reactive objects. To fit well
in an imperative object-oriented setting, reactive objects require special semantics
for the assignment of a field and method invocation. There is also a difference
in the semantics between accessor methods and mutator methods. reAcT is implemented
in the reflective layer of AmbientTalk, showing that it is possible to
leverage mirror-based reflection to define language extensions and semantics for
reactive programming in AmbientTalk.
We evaluate our language by employing it to build two concrete applications
which are well-known in the reactive programming domain.
Datum Prijs1 jul 2013
BegeleiderWolfgang De Meuter (Promotor), Coen De Roover (Jury), Ellie D'Hondt (Jury), Bart De Boer (Jury) & Kevin Pinte (Advisor)

Citeer dit