User loginNavigation |
Process Network for Effects, Monad AlternativeMonads are an awkward effects model in context of concurrency. We get incidental complexity in the form of futures or forking threads with shared memory. The running program becomes entangled with the environment, which hinders persistence and mobility and debugging. So I sought alternatives in literature. Kahn Process Networks (KPNs) seem like a very good alternative. From an external perspective, they share a lot of similarities to monads, except we get more than one input (continuation) and output (effect) port and thus can model concurrent operations without relying on effects or environment support. Internally, KPNs have a lot of similarities to free monads: we can compose KPNs to handle effects internally, translate them, etc.. Use of KPNs as first class values allows for dynamic structure and mobile processes. The main feature missing from KPNs is the ability to work with asynchronous inputs. But it is not difficult to add time to the model, and thus support asynchronous messaging and merges in a style similar to functional-reactive or flow-based programming (and somewhere between the two in terms of expressiveness). I doubt this is a new idea. I've written about these ideas in more detail on my blog:
Reactive KPNs with open ports or channels also make a better FRP than most, having a far more direct API for pushing inputs and pulling outputs deep within a network. By dmbarbour at 2016-12-14 17:38 | LtU Forum | previous forum topic | next forum topic | other blogs | 6108 reads
|
Browse archivesActive forum topics |
Recent comments
16 hours 44 min ago
17 hours 28 sec ago
19 hours 2 min ago
22 hours 24 min ago
6 days 16 hours ago
6 days 22 hours ago
1 week 15 hours ago
1 week 21 hours ago
1 week 23 hours ago
1 week 1 day ago