简体   繁体   English

反应式和函数式反应式编程的区别

[英]The difference between Reactive and Functional-Reactive programming

I have been doing some research into reactive programming recently and I'm finding it hard to find a good description of the difference between Reactive and Functional -Reactive.我最近一直在对反应式编程进行一些研究,我发现很难找到对反应式和函数式反应式之间区别的很好的描述。

Is it simply that the reactive programming is implemented using functional methods/paradigms as opposed to using declarative or OO paradigms?反应式编程是使用函数式方法/范式而不是使用声明式或面向对象范式来实现的吗?

Functional Reactive Programming (FRP) is a specific programming model with a specific semantics.函数式反应式编程(FRP)是一种具有特定语义的特定编程模型。 (Actually, there are two variants, which are sometimes called "classic FRP" and "arrow FRP".) I've given a summary in an answer to "What is (functional) reactive programming?" (实际上,有两种变体,有时称为“经典 FRP”和“箭头 FRP”。)我在“什么是(函数式)反应式编程?”的回答中给出了一个总结。 . . As I said there, the two key properties for me have always been (a) precise & simple denotation and (b) continuous time.正如我在那里所说的,对我来说,两个关键属性一直是 (a) 精确和简单的外延和 (b) 连续时间。 I regret that this model came to be called "functional reactive programming", for a few reasons:我很遗憾这个模型被称为“函数式反应式编程”,原因如下:

  • That name omits "time", and time is central for me.这个名字省略了“时间”,时间对我来说是核心。
  • The term "functional" has so little specific/clear meaning. “功能性”一词几乎没有具体/明确的含义。 I much prefer Peter Landin's suggested replacement "denotative".我更喜欢彼得兰丁建议的替代“外延”。 (See the quotes and reference in this blog comment .) (请参阅此博客评论中的引用和参考。)
  • It's easy for people to incorrectly think they know what the term means because they know meanings (more or less) of each of the three words.人们很容易错误地认为他们知道该术语的含义,因为他们知道(或多或少)三个词的含义。

For descriptiveness & accuracy, I prefer the term "denotative continuous-time programming" (suggested by Jake McArthur in a conversation a while back) over "functional reactive programming".为了描述性和准确性,我更喜欢术语“指示性连续时间编程”(由 Jake McArthur 在不久前的一次对话中提出)而不是“函数式反应式编程”。

I wrote a very short piece on the origin of FRP in the blog post Early inspirations and new directions in functional reactive programming .我在博客文章早期灵感和函数式反应式编程的新方向中写了一篇关于 FRP 起源的简短文章。

FRP is a combination of Functional programming(programming paradigm built upon the idea of everything is a pure function) and reactive programming paradigm (built upon the idea that everything is a stream(observer and observable philosophy)). FRP 是函数式编程(建立在一切都是纯函数的思想之上的编程范式)和反应式编程范式(建立在一切都是流的思想(观察者和可观察哲学)之上)的组合。 It is suppose to be the best of both the worlds.它被认为是两全其美的。

The definition of both give a more clear distinction between the two.两者的定义更清楚地区分了两者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 功能响应式编程语言规范 - Specification for a Functional Reactive Programming language 功能反应式编程的“信号”表示是否正确? - Is the 'Signal' representation of Functional Reactive Programming correct? 函数式编程和强类型化之间是否有任何联系? - Is there any link between functional programming and strong typing? 真正理解程序性和功能性的区别 - Truly understanding the difference between procedural and functional 编程语言中的语法和语义有什么区别? - What is the difference between syntax and semantics in programming languages? 为什么没有英语编程? 自然语言和编程语言之间有什么区别? - Why no programming in English? What is the difference between natural languages and programming languages? 系统编程语言与应用程序编程语言的区别 - Difference between Systems programming language and Application programming languages 函数式编程是命令式编程的一个子集吗? - Is functional programming a subset of imperative programming? 什么是“全功能编程”? - What is “Total Functional Programming”? 静态和动态编程语言之间的区别 - Difference between static and dynamic programming languages
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM