[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

The Viability Functional Reactive Frameworks

Simon Blackwell

3/2/2016 2:20:00 PM

I think functional reactive programming is a great paradigm and I have some concerns about its viability from a broad practical perspective. I would like to know the views of others on this matter ... at the risk of perhaps creating a little fire in the water.

My questions are:

1) Do people think that lower level FRP frameworks are practical for the majority of business application development?
2) If not, for what specific niches are they most appropriate?
3) Has anyone successfully moved a team of average programmers over to a lower level FRP framework? I have no doubt moving a top notch team at Google or Amazon is doable and in fact might drag thier manager there rather than vice-a-versa... I am more concerned about your average team an ACME Corp.

Note, I am not including higher level frameworks with a layer of templating on top like Ractive. And, I only choose cycle.js.org below as an example, there are others. I actually think cycle.js.org provides one of the cleanest most easy to grasp FRP frameworks.

I have managed hundreds of software developers in my career and also been exposed to the teaching of developers in both formal academic and less formal corporate environments. Here are my thoughts:

1) The the formal or informal educational capabilities don't exist to train people on how to use and apply most lower level functional reactive frameworks like that available at cycle.js.org.

2) The way of thinking about programming is so fundamentally different with FRP that one can actually introduce more risk by using it simply because the ability to find resources who get it and can manage/extend a code base is limited.

3) It sounds simple it theory and may be clear to those who "get it", but is in practice obtuse. Below is code from the home page of cycle.js.org:

function main(sources) {
const decrement$ = sources.DOM
.select('.decrement').events('click').map(ev => -1);

const increment$ = sources.DOM
.select('.increment').events('click').map(ev => +1);

const action$ = Observable.merge(decrement$, increment$);
const count$ = action$.startWith(0).scan((x,y) => x+y);

const vtree$ = count$.map(count =>
div([
button('.decrement', 'Decrement'),
button('.increment', 'Increment'),
p('Counter: ' + count)
])
);
return { DOM: vtree$ };
}

Although I know the code sums increment and de-crement clicks is really does not seem very transparent on the face of it. I think the average programmer would not get it without a lot of thought ... something for which insufficient time is often provided either by the programmer or the manager.

Lisp, particularly the Scheme variant, is/was an extraordinary language with lots of theoretical arguments in its favor, but it it not a very successful language.
9 Answers

John Harris

3/2/2016 3:27:00 PM

0

On Wed, 2 Mar 2016 06:20:11 -0800 (PST), Simon Blackwell
<syblackwell@anywhichway.com> wrote:

<snip>
>1) Do people think that lower level FRP frameworks are practical for the majority of business application development?
<snip>

I suspect that most people won't have an answer until someone says in
clear language what on earth "functional reactive programming"
actually is.

John

Scott Sauyet

3/2/2016 9:37:00 PM

0

John Harris wrote:
> Simon Blackwell wrote:

>> Do people think that lower level FRP frameworks are practical for
>> the majority of business application development?
>
> I suspect that most people won't have an answer until someone says in
> clear language what on earth "functional reactive programming"
> actually is.

Reactive programming is a style that looks at sources of data such as
user clicks and service responses as values changing over time, values as
streams which users can can combine or filter or alter in various ways.

Functional reactive programming adds typical functional transformations
to these streams, such as `filter`, `map`, a version of `reduce`. It can
be seen as a way to simplify the modeling of time in an application
without cluttering up code with too much state.

There are a number of libraries designed for dealing with this, including
RxJs [1], Bacon [2], Kefir [3], and Flyd [4].

ISTM that Cycle.js [5] is in a slightly separate category. Although it's
built atop FRP tools, its design is slightly more radical.

-----

As to whether these are production-ready, I think they have certainly shown
themselves able to survive the rigors of hard use, and some of them have
worked for large, disparate teams. But I have not seen evidence of
sustained use over long periods, so it's not clear if they'll hold up to
changing requirements or if they'll end up being mostly brittle solutions.

[1]: <http://reactiv...
[2]: <https://baconjs.gith...
[3]: <https://rpominov.github.io/...
[4]: <https://github.com/paldepin...
[5]: <http://cycle.j...

-- Scott

Michael Haufe (\"TNO\")

3/3/2016 2:07:00 AM

0

On Wednesday, March 2, 2016 at 8:20:19 AM UTC-6, Simon Blackwell wrote:
> I think functional reactive programming is a great paradigm [...]

....and has a nice history since 1997 starting with the following AFAICT:
<https://www.seas.harvard.edu/sites/default/files/files/archived/Czaplic...

Then traveling through Haskell with Conal Elliott:
<http://conal.net/blog/t...

and branched independently into .NET under Erik Meijer in Rx:

<https://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Brian-Beckman-and-Erik-Meijer-Inside-the-NET-Reactive-Framew...

who then popularized it independently at his company:
<http://www.applied-dualit...

after which it has been picked up by the mainstream proper. I think most notably IMO at Netflix:

<http://techblog.netflix.com/2013/01/reactive-programming-at-netfli...

> and I have some concerns about its viability from a broad practical perspective. I would like to know the views of others on this matter ... at the risk of perhaps creating a little fire in the water.

So in practice, there is real world evidence of this working, but like many paradigms: YMMV depending on the quality of the implementation and API details.

> My questions are:
>
> 1) Do people think that lower level FRP frameworks are practical for the majority of business application development?

it's built on top of map/filter/fold operations, so yes. Assuming what's built on top of it is a competent abstraction of course

> 2) If not, for what specific niches are they most appropriate?

Int the abstract, I would suggest reading David Barbour's comment on LTU:
<http://lambda-the-ultimate.org/node/4982#comment...

> 3) Has anyone successfully moved a team of average programmers over to a lower level FRP framework?

Move them into Functional Programming first, and the rest would feel obvious.


> Note, I am not including higher level frameworks with a layer of templating on top like Ractive. And, I only choose cycle.js.org below as an example, there are others. I actually think cycle.js.org provides one of the cleanest most easy to grasp FRP frameworks.

Learn the fundamentals underneath it and try to make a dummy implementation yourself. One of my personal favorites in the area is the following book:

"The Haskell School of Expression"
<http://www.amazon.com/Haskell-School-Expression-Functional-Programming/dp/0521644089/ref=sr_1_1?ie=UTF8&qid=1456970642&sr=8-1&keywords=The+Haskell+School+of+Expr...

> I have managed hundreds of software developers in my career and also been exposed to the teaching of developers in both formal academic and less formal corporate environments. Here are my thoughts:
>
> 1) The the formal or informal educational capabilities don't exist to train people on how to use and apply most lower level functional reactive frameworks like that available at cycle.js.org.
>
> 2) The way of thinking about programming is so fundamentally different with FRP that one can actually introduce more risk by using it simply because the ability to find resources who get it and can manage/extend a code base is limited.
>
> 3) It sounds simple it theory and may be clear to those who "get it", but is in practice obtuse. Below is code from the home page of cycle.js.org:
>
> function main(sources) {
> const decrement$ = sources.DOM
> .select('.decrement').events('click').map(ev => -1);
>
> const increment$ = sources.DOM
> .select('.increment').events('click').map(ev => +1);
>
> const action$ = Observable.merge(decrement$, increment$);
> const count$ = action$.startWith(0).scan((x,y) => x+y);
>
> const vtree$ = count$.map(count =>
> div([
> button('.decrement', 'Decrement'),
> button('.increment', 'Increment'),
> p('Counter: ' + count)
> ])
> );
> return { DOM: vtree$ };
> }
>
> Although I know the code sums increment and de-crement clicks is really does not seem very transparent on the face of it. I think the average programmer would not get it without a lot of thought ... something for which insufficient time is often provided either by the programmer or the manager.
>
> Lisp, particularly the Scheme variant, is/was an extraordinary language with lots of theoretical arguments in its favor, but it it not a very successful language.

Like I mentioned earlier: YMMV depending on the quality of implementation. Try it yourself.

Start with Erik Meijer's videos and presentations.

Scott Sauyet

3/3/2016 3:34:00 AM

0

Michael Haufe (TNO) wrote:
> Simon Blackwell wrote:
> > I think functional reactive programming is a great paradigm [...]
>
> ...and has a nice history since 1997 starting with the following AFAICT:
> <https://www.seas.harvard.edu/sites/default/files/files/archived/Czaplic...

That link seems to point to a paper dated 2012.

> Then traveling through Haskell with Conal Elliott:
> <http://conal.net/blog/t...

Most references I've seen trace back to Elliott, or specifically to
Elliott and Hudak's 1997 paper:

<http://conal.net/papers/icfp97/icfp...

-- Scott

Michael Haufe (\"TNO\")

3/3/2016 5:30:00 AM

0

On Wednesday, March 2, 2016 at 9:34:03 PM UTC-6, Scott Sauyet wrote:
> Michael Haufe (TNO) wrote:

> > ...and has a nice history since 1997 starting with the following AFAICT:
> > <https://www.seas.harvard.edu/sites/default/files/files/archived/Czaplic...
>
> That link seems to point to a paper dated 2012.
>
> > Then traveling through Haskell with Conal Elliott:
> > <http://conal.net/blog/t...
>
> Most references I've seen trace back to Elliott, or specifically to
> Elliott and Hudak's 1997 paper:
>
> <http://conal.net/papers/icfp97/icfp...

Good catch. That was the one I was staring at as I copy/pasted from the wrong tab. I typed the correct the year right at least... <.<

Sbez

3/4/2016 1:19:00 PM

0

I don't know what you mean by FRP,have followed eXtreme programming skills functional pattern testing framework methodologies and used them with an eMac that wouldn't revert too deploying classic 9 too it's tiger,however it has now given over its startup disk to be a network volume where there are elements of pooling this disk too other machines and platforms as even runs el captain on this partition!it doesn't use such itself but has recently created lots of directories for developments that are selected into frameworks which are again large directories that never seen before on any Apple especially an eMac,which have possible connections with larger quad G5 that is down at the moment but runs openAFS with CERN hadron collider that eMac converts openldap services into university websites! This as also produces many other updates or upgrades of apples other application,including swift and objective-c that deployed eXtreme function programming before testing was realized as Delta not following along from beta as releases!
Google was originally a Britsh board of inventors win of continuing with development programs that involved a thing known as Memex which was the desktop dream of those earlier inventions of the said developments,which the Brits then informed everyone they had encrypted,therefore Google as a whole is only known too be visible as that partial of the Internet which is an engine,therefore very volatile and certainly hasn't been known to be worked on or with,although these recent developments come from open source engagements that publicized themselves with interests of a little known library indexing machine that was built a long time before modular engineering existed as a mindless thought of compute has,the Zuees? This,apparently,has other unciphered pure source relations with gnu.org archivists that allowed red hat and Debian too be sort after as an whole organization the darkest underworlds unknown,which is an exact repeat of the effects of the Google programmed British enigma freak out towards governors as men in offices seen as those in control,etc? Hence too cause suspect ion against Linux or UNIX as all things were awaiting Windows 7 arrival at this time,apparently,the German connections of the reasons unknown that emac so ready other educational system end machines produced the countries cipher outputs as names and address international computing so which were then allied too chrome browser and the Susie Linux foundation as a path of clarity was able too bypass the Beatles Apple New York ring of roses leading people's into worldly beliefs with the use of the consumed ciphers affect by calling a-z as joes garage vocative synclavia where Susie Linux had been frank zappas choice use of certain sound fonts that had become rare and unknown as even the use reclaimed yells of slang and hanky rubbish,we are beat poet trained IBM officials of order your close down as expects too stand up licenses as ordering copyrights of slang into rules that all you must talk and use for no further informations as classified behaviors have been found too corrupt,please do not watch internet as information you concider to be alike your own television that comes home too upturn all that you know too walk on you as the moony earthed billed and own loony tune demanded by acts of unknowns who you ask too come and own you as soldiers of warring mass social systems which was part of the post offices design of ciphers that wouldn't ever be believed by you as rules are people individual expressions piled into an unknown ferment that then accords hearings synthetically assumed and totally unknown,etc?


Stefan Weiss

3/4/2016 2:23:00 PM

0

On 03/04/2016 14:19, Sbez wrote:
> I don't know what you mean by FRP

To save others the trouble of wading through that wall of text, that was
the only on-topic part of the whole post.

The rest looks like it was created by the brilliant mind of Mentifex, or
possibly one of his creations.

- stefan

Scott Sauyet

3/4/2016 4:01:00 PM

0

Stefan Weiss wrote:
> Sbez wrote:

>> I don't know what you mean by FRP
>
> To save others the trouble of wading through that wall of text, that was
> the only on-topic part of the whole post.
>
> The rest looks like it was created by the brilliant mind of Mentifex, or
> possibly one of his creations.

But, while reading it is worthless, scanning it can be fun:

* frank zappas
* Susie Linux
* British enigma freak out
* vocative synclavia
* ring of roses
* individual expressions piled into an unknown ferment

What's not to like? :-)

-- Scott

mentificium

3/4/2016 10:04:00 PM

0

On Friday, March 4, 2016 at 6:22:59 AM UTC-8, Stefan Weiss wrote:
> On 03/04/2016 14:19, Sbez wrote:
> > I don't know what you mean by FRP
>
> To save others the trouble of wading through that wall of text,
> that was the only on-topic part of the whole post.
>
# The rest looks like it was created by the brilliant mind of Mentifex,
# or possibly one of his creations.
#
# - stefan

You rang? The barely functional mind of Mentifex
has been _extremely_ busy in this New Year of 2016.

http://www.nlg-wiki.org/sy... AI in JavaScript

for MSIE was translated a few years ago into Russian as

http://www.nlg-wiki.org/syst... also for MSIE.

Then in April 2015 Mentifex here started learning Perl5
and began re-coding the AI Mind in Perl for a few months.

When the long-awaited Perl6 was released in December 2015,
very truly your Mentifex launched a massive campaign to
create an AI Perlmind "Ghost" as the Perl6 "Killer App."

http://ai.neocities.org/pe... is the free AI source code.

http://ai.neocities.org/P6A... -- Perl6 AI User Manual;

http://ai.neocities.org/P6A... -- Frequently Asked Questions;

http://www.sourcecodeonline.com/details/ghost_perl_webserver_stro...

is an especially interesting statement of what Mentifex is up to.

Thank you for this opportunity to report to the Netizenry.

Over and out,

Mentifex
--
http://ai.neocities.org/Ai...
http://www.amazon.com/dp/...
http://www.nlg-wiki.org/sy....Forth
http://aihub.net/artificial-intelligence-la...