Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 393
seadowg Avatar asked Mar 22 '11 00:03

seadowg


People also ask

Is react functional reactive programming?

React in itself is not fully functional, nor is it fully reactive. But it is inspired by some of the concepts behind FRP. Functional components for instance are pure functions with respect to their props. And they are reactive to prop or state changes.

What is meant by reactive programming?

Reactive programming describes a design paradigm that relies on asynchronous programming logic to handle real-time updates to otherwise static content. It provides an efficient means -- the use of automated data streams -- to handle data updates to content whenever a user makes an inquiry.

What is reactive and imperative programming?

Imperative programming means you are responsible for pulling an event off of a queue. Reactive programming means you register a callback and a framework is responsible for calling your callback correctly. In most non-JavaScript languages, imperative programming is the de facto standard.

What is FRP in programming?

FRP is the combination of functional and reactive paradigms. In other words, it is reacting to data streams using the functional paradigm. FRP is not a utility or a library — it changes the way you architect your applications and the way you think about your applications.

Is it better to use functional programming or reactive programming?

One can use Functional programming or Reactive programming. It depends on the application you want to build and its requirements. Functional programming paradigm is built upon the idea that everything is a pure function. Reactive programming paradigm is built upon the idea that everything is a stream observer and observable philosophy.

What is reactive programming and how does it work?

Reactive programming is the practice of programming with asynchronous data streams or event streams. An event stream can be anything like keyboard inputs, button taps, gestures, GPS location updates, accelerometer, and iBeacon. You can listen to a stream and react to it accordingly.

What is functional reactive programming (FRP)?

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?" .

What is reactive software development and design?

When people talk about “reactive” in the context of software development and design, they generally mean one of three things: 1 Reactive systems (architecture and design) 2 Reactive programming (declarative event-based) 3 Functional reactive programming (FRP)


1 Answers

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.

like image 116
Conal Avatar answered Oct 05 '22 19:10

Conal