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

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.
主站蜘蛛池模板: 江口县| 南靖县| 越西县| 福贡县| 万全县| 福贡县| 长海县| 休宁县| 秭归县| 雷州市| 林口县| 滕州市| 商城县| 八宿县| 奉化市| 岳普湖县| 济阳县| 河源市| 昌邑市| 宜都市| 荃湾区| 蒲城县| 增城市| 彭泽县| 康保县| 景德镇市| 青阳县| 凌海市| 德格县| 枝江市| 辽宁省| 桓仁| 明光市| 铜鼓县| 昭觉县| 青川县| 遂昌县| 洪雅县| 明星| 丽水市| 常州市|