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

发布于 2024-10-25 19:58:45 字数 118 浏览 2 评论 0 原文

我最近一直在对反应式编程进行一些研究,我发现很难找到反应式和函数式-反应式之间差异的良好描述。

反应式编程是否只是使用函数式方法/范式而不是使用声明式或面向对象范式来实现?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无法言说的痛 2024-11-01 19:58:45

函数式响应式编程(FRP)是一种具有特定语义的特定编程模型。
(实际上,有两种变体,有时称为“经典 FRP”和“箭头 FRP”。)
我在回答“什么是(函数式)反应式编程”中给出了总结?”
正如我在那里所说的,对我来说两个关键属性始终是(a)精确和精确。简单的表示和(b)连续时间。
我很遗憾这个模型被称为“函数式反应式编程”,原因如下:

  • 这个名称省略了“时间”,而时间对我来说至关重要。
  • “功能性”一词几乎没有具体/明确的含义。
    我更喜欢彼得·兰丁建议的替代“外延”。
    (请参阅此博客评论中的引用和参考。)
  • 人们很容易错误地认为他们知道该术语的含义,因为他们(或多或少)知道这三个单词中每一个的含义。

为了描述性和准确性,我更喜欢术语“指示性连续时间编程”(由杰克·麦克阿瑟在不久前的一次谈话中提出)而不是“函数式反应式编程”。

我在博客文章 函数响应式编程的早期灵感和新方向

Functional Reactive Programming (FRP) is a specific programming model with a specific semantics.
(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?".
As I said there, the two key properties for me have always been (a) precise & simple denotation and (b) continuous time.
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".

I wrote a very short piece on the origin of FRP in the blog post Early inspirations and new directions in functional reactive programming.

盛夏尉蓝 2024-11-01 19:58:45

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)). It is suppose to be the best of both the worlds.

The definition of both give a more clear distinction between the two.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文