官术网_书友最值得收藏!

First-order FRP

The most well-known reactive language in this category is Elm (see http://elm-lang.org/), an FRP language that compiles to JavaScript. It was created by Evan Czaplicki and presented in his paper Elm: Concurrent FRP for Functional GUIs[3].

Elm makes some significant changes to higher-order FRP.

It abandons the idea of continuous time and is entirely event-driven. As a result, it solves the problem of needless recomputation, which was highlighted earlier. First-order FRP combines both behaviors and events into signals, which, in contrast to higher-order FRP, are discrete.

Additionally, first-order FRP allows the programmer to specify when the synchronous processing of events isn't necessary, preventing unnecessary processing delays.

Finally, Elm is a strict programming language, meaning that arguments to functions are evaluated eagerly. This is a conscious decision, as it prevents space and time leaks, which are possible in a lazy language such as Haskell.

In an FRP library such as Fran, which has been implemented in a lazy language, memory usage can grow unwieldy as computations are deferred to the absolutely last possible moment, therefore causing a space leak. These larger computations, which are accumulated over time due to laziness, can then cause unexpected delays when finally executed, thus causing time leaks.
主站蜘蛛池模板: 云安县| 浮梁县| 陆丰市| 莒南县| 行唐县| 汝州市| 滦平县| 轮台县| 蓬莱市| 丰原市| 星子县| 阳西县| 甘孜县| 巨鹿县| 菏泽市| 临桂县| 昭觉县| 四平市| 临安市| 乐清市| 广西| 陵水| 崇州市| 石首市| 泸溪县| 淳安县| 道真| 巴中市| 竹溪县| 彩票| 宁陕县| 永善县| 中宁县| 周至县| 洛宁县| 读书| 台东市| 射洪县| 庐江县| 博乐市| 舒城县|