--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Whereas the first example receives all incremented values, the second one receives potentially less since both consumers read from the very same input channel! This also means that one can break working code, by (accidently) attaching an additional consumer ... note that in Rx I can subscribe as many times as I want to an observable without any effect on the rest of the data flow.
Maybe I'm misunderstanding CSP and how it allows to compose and synchronize processes, but somehow I feel that channels complect the idea of state varying values and identity. Regarding that referential transparency, which is required for equational reasoning, is one of the best properties of purely functional programs, breaking it seems to be at least problematic
Whereas the first example receives all incremented values, the second one receives potentially less since both consumers read from the very same input channel! This also means that one can break working code, by (accidently) attaching an additional consumer ... note that in Rx I can subscribe as many times as I want to an observable without any effect on the rest of the data flow.
Which also creates a resource problem as a result of the subscription side effect. You can build subscription based on Rx over core.async if you like, but I think it's more of a tradeoff than people realize.
Problematic in what real sense? Haskell provides similar facilities over the Chan data type. Clearly they also believe it's useful to model problems in this way.
David
As far as I know, Haskell has Chan data types in its concurrency extensions, but I have never seen them in FRP. Maybe this means that FRP is addressing a different problem. On the other hand, the Automaton Arrow can be used to implement state machines that transition on receiving inputs in a composable and referentially transparent way ... but they still have some problems regarding efficiency and space-leaks.
On Tue, Sep 3, 2013 at 10:47 AM, bertschi <nils.ber...@googlemail.com> wrote:
As far as I know, Haskell has Chan data types in its concurrency extensions, but I have never seen them in FRP. Maybe this means that FRP is addressing a different problem. On the other hand, the Automaton Arrow can be used to implement state machines that transition on receiving inputs in a composable and referentially transparent way ... but they still have some problems regarding efficiency and space-leaks.
referential transparency without efficiency with space leaks is not what I call a path towards correctness. I am sure pure FRP implementations will one day widely surmount these obstacles towards correctness. I'm personally not going to wait - a tunable CSP model seems better suited to the construction of correct (in the sense that it actually reliably works for the end user, not proof) interactive programs.
That said core.async is not anti-FRP, most of the code that I've written using core.async leverages an FRP style quite liberally, but it's refreshing to not be ball-and-chained to that approach when writing interactive programs.
David
Just an aside, Nils, have you take a look at Elm? It's a Haskell-like
language, designed for FRP, compiles to JS, and deliberately avoids
monads and arrows (at least in terminology) by having Signal and
Automaton abstractions... http://elm-lang.org