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

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.
主站蜘蛛池模板: 渝北区| 昭通市| 会理县| 天气| 方城县| 隆尧县| 临沂市| 临沧市| 高清| 饶阳县| 上栗县| 上林县| 彰化市| 镇赉县| 崇义县| 大新县| 双桥区| 慈利县| 鱼台县| 湘乡市| 吴江市| 临泽县| 略阳县| 普宁市| 赤水市| 夏津县| 集安市| 济南市| 新竹市| 新丰县| 军事| 潢川县| 镇宁| 龙海市| 肃南| 五寨县| 库伦旗| 太康县| 兴业县| 平利县| 恭城|