I've just published an FRP library based on Elm[1]:

https://github.com/jamesmacaulay/zelkova

Here's what the app code looks like:

https://github.com/jamesmacaulay/zelkova/blob/4b06c49678e11e3af7b1eda7a18929a512f7753d/examples/mario/src/mario/core.cljs#L118-L133

Right now Zelkova includes ports of Elm's Signal, Mouse, Keyboard, and 
Window libraries, plus part of its Time library[2]. Zelkova's signal 
namespace works in both Clojure and ClojureScript, but the rest only have 
implementations for ClojureScript in the browser.

Elm-style FRP is a bit different from other flavours like those of Rx or 
Bacon.js. In particular, Elm's signal graphs are static (can't be 
reconfigured once they start running) and don't allow for 
signals-of-signals.

Zelkova is the same way, but its signal functions actually return "recipes" 
for signals which don't start processing values until a "live" graph gets 
spawned from one of them. This allows multiple live graphs to run 
concurrently while sharing logical structure, and should make some things 
easier in the future (like porting Elm's time-travelling debugger). 
Theoretically this should also make it possible to compile some kinds of 
signal graphs into transducers instead of running them as networks of 
core.async channels.

If you're interested in the differences and tradeoffs between the different 
forms of FRP out there, Evan Czaplicki gave an excellent talk on the 
subject at Strange Loop this year:

https://www.youtube.com/watch?v=Agu6jipKfYw

Cheers,
James

[1] http://elm-lang.org
[2] 
https://github.com/jamesmacaulay/zelkova/tree/master/src/cljx/jamesmacaulay/zelkova

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to