DeepAI AI Chat
Log In Sign Up

Harmonizing Signals and Events with a Lightweight Extension to Java

by   Tetsuo Kamina, et al.

The current demands for seamless connections with the surrounding environment make software more reactive. For example, such demands are evident in systems consisting of the Internet of Things. Such systems include a set of reactive values that are periodically updated in response to external or internal events to form a dataflow in the sense that such updates are propagated to other reactive values. Two effective approaches for realizing such reactive values have been proposed: the event mechanisms in event-based programming and the signals in functional-reactive programming. These two approaches are now becoming mixed in several languages such as Flapjax and REScala, which makes these languages notably expressive for modularizing the implementation of reactive software. For example, REScala provides a rich API that consists of functions converting events to signals and vice versa. In this paper, we explore another, simpler approach in the design space of reactive programming languages: the event mechanism is harmonized with signals, resulting in a simplified programming interface that is mostly based on signals. Based on this approach, we realize SignalJ, a simple extension of Java with events and signals. Our notable findings are (1) an event can be represented as an update of a signal and (2) such an effectful signal can be represented using annotations instead of introducing types and constructors for signals to further simplify the language. Another contribution of this paper is the formal model of SignalJ. As both mechanisms of events and signals may interfere with each other, this mixing sometimes results in surprising behavior. For example, the functional behavior of signals is affected by the imperative features of events. Thus, understanding the formal model of this mixing is actually important. The core calculus, Featherweight SignalJ (FSJ), was developed as an extension of Featherweight Java, and proofs are provided to ensure the soundness of FSJ.


page 1

page 2

page 3

page 4


Simply RaTT: A Fitch-style Modal Calculus for Reactive Programming without Space Leaks

Functional reactive programming (FRP) is a paradigm for programming with...

Simply RaTT: A Fitch-style Modal Calculus for Reactive Programming

Functional reactive programming (FRP) is a paradigm for programming with...

Vehicle Platooning Simulations with Functional Reactive Programming

Functional languages have provided major benefits to the verification co...

Topology-Level Reactivity in Distributed Reactive Programs: Reactive Acquaintance Management using Flocks

Reactive programming is a popular paradigm to program event-driven appli...

An Event-based Compositional Reasoning Approach for Concurrent Reactive Systems

Reactive systems are composed of a well defined set of input events that...

Diva: A Declarative and Reactive Language for In-Situ Visualization

The use of adaptive workflow management for in situ visualization and an...

Evolving Event-driven Programs with SignalGP

We present SignalGP, a new genetic programming (GP) technique designed t...