REBLS 2022: Proceedings of the 9th ACM SIGPLAN International Workshop on Reactive and Event-Based Languages and Systems

Full Citation in the ACM Digital Library

SESSION: Papers

Towards Introducing Asynchronous Tasks to an FRP Language for Small-Scale Embedded Systems

Emfrp is a functional reactive programming language designed for small embedded systems. By imposing certain restrictions on the language mechanism, the language guarantees the termination of the update process for each time-varying value and enables static determination of the amount of memory required for execution. This allows Emfrp programs to run safely even in resource-constrained execution environments. However, the abovementioned restrictions make it difficult to write time-consuming operations (heavy tasks) such as graph structure construction and exploration based on external data. Moreover, since Emfrp updates time-varying values synchronously, a naive implementation of such heavy tasks using external function calls will result in a slow response time to input. Some existing programming languages provide asynchronous processing mechanisms to ensure descriptiveness and responsiveness for heavy tasks. In this study, we propose a method to introduce heavy tasks into reactive programs naturally by introducing language mechanisms equivalent to asynchronous processing mechanisms, such as future and promise, into Emfrp. In this paper, we first discuss the problems with a naive implementation of heavy tasks in Emfrp, then explain the proposed method based on an example, and discuss the language runtime implementation.

Distributed Persistent Signals: Architecture and Implementation

A signal in reactive programming (RP) is a function of time whose value is updated automatically without performing explicit re-assignments. SignalJ, a Java-based RP language, provides persistent signals, whose update histories constitute time-series data, i.e., a signal is a function of a specified (possibly past) time. These update histories are stored in a time-series database to facilitate the use of persistent signals in an open, distributed setting. However, currently SignalJ is only used in local systems, and there are several obstacles to making it applicable to distributed systems. In this study, we address this problem by proposing a distributed architecture for the SignalJ runtime platform. This architecture includes an ID resolver that makes persistent signals location-transparent and supports a distributed update propagation mechanism that makes distributed time-series data consistent. We realize this architecture by extending the SignalJ compiler and its runtime library as well as providing an add-on to the time-series database. The effectiveness of this architecture is demonstrated by implementing a simple IoT application using this extension.

FLOREnce: A Hybrid Logic-Functional Reactive Programming Language

Functional reactive programming (FRP) languages allow programmers to write declarative expressions to denote event-streams. They feature operators (e.g., map, filter, merge, ...) to build compositions of events. Among these operators we would expect to find the traditional Boolean operators to express complex events. To some extent this is true. However, a remarkable absent in existing FRP languages is the logical conjunction, i.e., the and operator. In this paper, we describe the difficulty of introducing logical conjunction in FRP. We then present a new experimental language called FLOREnce that reconciles functional reactive programming with ‘logic reactive programming’ abstractions. The latter emerge naturally when adding a reactive conjunction operator to an event-based FRP language. We present a prototypical implementation of FLOREnce and we study its expressiveness by conducting an experiment.

Semantics of RxJS

RxJS is a popular JavaScript library for reactive programming in Web applications. It provides numerous operators to create, combine, transform, and filter discrete events and to handle errors. These operators may be stateful and have side effects, which makes it difficult to understand the precise meaning of the resulting computation. In this paper, we define a formal model for RxJS programs by formalizing a selected subset of RxJS operators using a small-step operational semantics. We present several debugging related applications using the semantics as a model. We also implemented a subset of RxJS based on this semantics, which provides convenient access to the runtime representation of the RxJS program to help debugging.

Reactive Programming on the Bare Metal: A Formal Model for a Low-Level Reactive Virtual Machine

Reactive programming has many applications for embedded devices in IoT and other application domains. For these constrained devices it is crucial to bound the overhead of the execution of non-functional concerns such as glitch freedom. Reactive programming languages with static dependency graphs can implement glitch freedom by topologically sorting the dependency graph ahead of time. However, for more traditional reactive programming languages that support a dependency graph that can dynamically change, glitch freedom is typically implemented using a priority queue in which signals are enqueued according to their location in the graph. This is undesirable for embedded devices, as dynamically updating this priority queue has an undesirable, and sometimes unbounded, overhead. In this paper, we present a small-step operational semantics of a virtual machine specialised for running reactive programs that combines static ahead-of-time compilation of reactive programs into topologically sorted dependancy graphs while maintaining support for dynamic modifications to those dependency graphs.