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

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.
主站蜘蛛池模板: 乐清市| 章丘市| 邹平县| 内乡县| 富裕县| 太仆寺旗| 延吉市| 乌恰县| 宣汉县| 泰州市| 柯坪县| 蓝山县| 呼图壁县| 宜良县| 虎林市| 宁都县| 易门县| 额济纳旗| 英山县| 康定县| 高尔夫| 肇源县| 团风县| 筠连县| 长顺县| 保山市| 双流县| 广宗县| 晋江市| 富顺县| 上思县| 湖南省| 屏南县| 寻乌县| 双柏县| 新郑市| 慈溪市| 察哈| 青河县| 宜州市| 商丘市|