• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is FRP a paradigm?

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi FRP book author(s),
Is FRP a programming paradigm or a design pattern, involving immutable objects, lambdas, closures, functional programming, etc, or is it some programming language which facilitates the use of all these patterns?  If this is only a paradigm, then --
1. Is the book organised like a typical design pattern book? Does it have enough examples? If so, in which language?
2. Please suggest the best programming languages to implement FRP (please include Java, Scala, C++, etc, in your ranking).
Thanks much, Sudd
 
Author
Posts: 12
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sudd,

It depends somewhat on definitions, so maybe I'd be most accurate if I tried to summarize what FRP is: It's a functional "wrapping" of event-based logic. If you are used to the normal way of handling events, then a different way of thinking is required. In that respect, it's a different paradigm. It's not a programming language, but it definitely could be described as an EDSL - an embedded domain-specific language, meaning that it is embedded in a host language such as Java. The implementation is simply a small library.

1. The book starts off by explaining the basics of FRP and the thinking behind it, and then it gives examples of how to use it in a wide array of different cases. Each case is illustrated with an example. There are several quite large, involved examples. All the example code is at https://github.com/SodiumFRP/sodium/tree/master/book

The primary language is Java but there is a chapter devoted to Rx.JS and Javascript, mainly dealing with how to use Rx.JS to write FRP-style code.

2. How good a language is to implement FRP depends on what its syntax is like with typical FRP code - especially lambda syntax. Java, C#, Scala, Typescript and Haskell are all really good. Javascript and C++ are a bit clunky due to lambda syntax (Javascript) and type names (C++). Automatic memory management was a big challenge in Javascript/Typescript and C++ but this was recently solved.


Steve
 
Sudd Ghosh
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks much Steve for the detailed explanation. I am sure it will feel refreshing to read the event handling logic changes.
Realizing, I am still picking pebbles on the sea shore. So many more things to learn..
 
Self destruct mode activated. Instructions for deactivation encoded in this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic