12

I've been using Reactive Cocoa (by GitHub), a Functional Reactive Programming API for use with the Cocoa libraries for a while now, but have just read "Out of the Tar Pit", the paper that supposedly presents the concepts behind it, and I am a little confused.

The paper presents (as I understand it) Functional Relational Programming, where relations between data are created with conditions that should be enforced by the FRP system to reduce the amount of 'accidental' logic and state needed.

My question is, are these two concepts - FR(eactive)P and FR(elational)P essentially the same thing (with the former just being an implementation of the latter) or is there a core difference between the two? Unfortunately at the moment my knowledge of the area isn't good enough for me to differentiate them enough.

If there is a difference, it appears to be something to do with, as the name suggests, reacting to changes in data. Certainly, Reactive Cocoa (and Rx in C#) have the concept of creating signals which are triggered on changes in data, and can be used to continuously modify a value over time.

Is this the difference? If not, what is?

(Please excuse the poor tagging, I can't find relevant tags and can't create them yet - please update the tags to something more appropriate if you can.)

1
  • 2
    "Out of the Tar Pit" doesn't present the concepts behind functional reactive programming – it's just a good read to understand why state is harmful. Most of it applies to pure FP, FRelP, and FReaP. Apr 12, 2013 at 17:00

1 Answer 1

5

A reaction can propogate a change without involving a relational model. C = A + B Change A and/or B and C will react to the change (but could end up with the same value). On p. 42

The approach of functional relational programming (FRP16) derives its name from the fact that the essential components of the system (the logic and the essential state) are based upon functional programming and the relational model (see Figure 2).

footnote 16

Not to be confused with functional reactive programming [EH97] which does in fact have some similarities to this approach, but has no intrinsic focus on relations or the relational model

2
  • Ah I see. There seems to be a lot of cross-over with the reactive frameworks I mentioned and Functional Relational Programming, certainly there are some of the concepts present, but they also draw their concepts of signals from that second paper's Behaviours and Events.
    – danpalmer
    Apr 12, 2013 at 16:49
  • 3
    The cross-over is mostly at the level of pure FP. The relational and reactive paradigms don't really have much in common. Apr 12, 2013 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.