Active Expressions: Basic Building Blocks for Reactive Programming

Active Expressions: Basic Building Blocks for Reactive Programming
复制标题

DOI:
10.22152/programming-journal.org/2017/1/12
复制
发表时间:
2017-03
期刊:
ArXiv
影响因子:
--
通讯作者:
Stefan Ramson;R. Hirschfeld
Stefan Ramson;R. Hirschfeld
中科院分区:
其他
文献类型:
--
作者:
Stefan Ramson;R. Hirschfeld

文献摘要

被引文献

相似文献

没有反应式编程的现代软件开发是难以想象的。响应式编程支持多种当代软件系统,这些系统可以响应用户输入、网络消息和其他事件。虽然反应式编程是一个活跃的研究领域,但反应式概念的实现仍然具有挑战性。特别是,变化检测是实现反应式概念时的一个困难但不可避免的必要条件。通常,变更检测机制并不打算重用,而是与特定的变更解决机制紧密耦合。因此,开发人员经常不得不重新实现类似的抽象。仍然缺少用于变化检测的可重用原语。为了找到一个合适的原语,我们确定现有的反应概念的共性。我们发现了一类反应概念,基于状态的反应概念。所有基于状态的反应式概念都有一个共同的变化检测机制:它们检测表达式求值结果的变化。在此基础上,我们提出了一种可重用的原语活动表达式。通过抽象变化检测的繁琐实现细节,主动表达式可以简化反应式编程概念的实现。我们评估的设计活动表达式重新实现了一些现有的基于状态的反应式的概念,使用它们。由此产生的实现突出了活动表达式的表现力。当推理反应式编程概念时,活动表达式可以将基本部分与非基本部分分离。通过使用活动表达式作为变更检测的原语,反应式语言构造和运行时支持的开发人员现在可以专注于设计应用程序员应该如何对变更做出反应。最终,我们希望主动表达式能够鼓励人们尝试新的反应式编程概念,并由此产生更多的可供探索的概念。
Modern software development without reactive programming is hard to imagine. Reactive programming favors a wide class of contemporary software systems that respond to user input, network messages, and other events. While reactive programming is an active field of research, the implementation of reactive concepts remains challenging. In particular, change detection represents a hard but inevitable necessity when implementing reactive concepts. Typically, change detection mechanisms are not intended for reuse but are tightly coupled to the particular change resolution mechanism. As a result, developers often have to re-implement similar abstractions. A reusable primitive for change detection is still missing. To find a suitable primitive, we identify commonalities in existing reactive concepts. We discover a class of reactive concepts, state-based reactive concepts. All state-based reactive concepts share a common change detection mechanism: they detect changes in the evaluation result of an expression. On the basis of the identified common change detection mechanism, we propose active expressions as a reusable primitive. By abstracting the tedious implementation details of change detection, active expressions can ease the implementation of reactive programming concepts. We evaluate the design of active expressions by re-implementing a number of existing state-based reactive concepts using them. The resulting implementations highlight the expressiveness of active expressions. Active expressions enable the separation of essential from non-essential parts when reasoning about reactive programming concepts. By using active expressions as a primitive for change detection, developers of reactive language constructs and runtime support can now focus on the design of how application programmers should be able to react to change. Ultimately, we would like active expressions to encourage experiments with novel reactive programming concepts and with that to yield a wider variety of them to explore.