Functional Reactive Programming, restated

Functional Reactive Programming, restated
复制标题

函数式反应式编程,重述

DOI:
--
复制
发表时间:
2019
期刊:
ACM-SIGPLAN International Conference on Principles and Practice of Declarative Programming
影响因子:
--
通讯作者:
H. Nilsson
H. Nilsson
中科院分区:
--
文献类型:
--
作者:
Guerric Chupin;H. Nilsson

文献摘要

被引文献

相似文献

函数式反应式编程(Functional Reactive Programming)是一种通过描述时变值之间的交互来对反应式系统进行声明性编程的方法。FRP实现通常被实现为嵌入在函数式宿主语言中,从而形成非常具有表现力的反应式编程框架。然而,这种表现力是有代价的:当前的嵌入式FRP实现会产生大量的性能开销,特别是对于(理论上)连续变化的值。FRP的基本思想与同步数据流和连续系统仿真语言密切相关。与FRP相反,这些函数可以有效地处理连续变化的值,但表达性较差。本文旨在弥合这一差距,提出了一种新的方法,嵌入式FRP实现,使用同步数据流和模拟语言的基本实现方法,有效地处理连续变化的值,同时保留通常与FRP相关的表现力,以及关注的值,只改变相对不频繁。这些想法适用于FRP之外,例如用于实现灵活的嵌入式仿真语言。我们在一系列基准上评估了我们的方法,包括现有的成熟的视频游戏,其中使用我们新的FRP实现作为旧的替代品,性能提高了三倍。
Functional Reactive Programming is an approach to declarative programming of reactive systems by describing interactions between time-varying values. FRP implementations are often realised as an embedding in a functional host language, making for very expressive reactive programming frameworks. However, this expressiveness comes at a cost: current embedded FRP implementations incur substantial performance overheads, in particular for values that (notionally) vary continuously. The basic idea of FRP is closely related to synchronous data-flow and continuous system simulation languages. In contrast to FRP, these handle values that vary continuously efficiently, but are less expressive. This paper seeks to bridge this gap by proposing a novel approach to embedded FRP-implementation that uses the fundamental implementation approach of synchronous datalow and simulation languages for efficient handling of continuously varying values, while retaining the expressiveness normally associated with FRP, as well as paying attention to values that only change relatively infrequently. These ideas are applicable beyond FRP, for example for implementing flexible embedded simulation languages. We evaluate our approach on a range of benchmarks, including an existing full-fledged video game where using our new FRP implementation as a drop-in replacement for the old one gave a three-fold performance improvement.