native functional reactive programming

date: 2020-01-09

tags: technology

react et al are very much in the functional programming camp. i personally like that style of programming, even though it does incur a cost. i wont touch web unless i'm getting paid so you probably won't see any of my stuff running in a browser any time soon.

vdom isn't the fastest way to render stuff on web, but it does give you some decent tools for managing the complexity of big gui applications. that's the trade-off you make if you want do use FRP to make your ui. the frp model is very slow on web because even reading properties off the dom is very slow. vdom takes the output of the ui function and applies it to the vdom before hitting the actual (slow) dom.

languages like elm can take this a step further. because of the language semantics, they can avoid the vdom too in some cases.

there are certainly other ways this kind of thing could be optimized, but that's also dependent on the domain you're trying to work in. i'm interested in native FRP on top of SDL2 and its unlikely that there will be scene diffing involved. my goals with native FRP are to find a way to make efficient imperative calls to SDL based on a high-level functional representation of the program.