|
|
On 13/05/2011 12:32, Invisible wrote:
> http://tinyurl.com/678c9xo
>
> Implementing Erlang's distributed processing model in Haskell. (This is
> a work in progress. I doubt it's production-ready yet - or any time soon.)
> Erlang's basic idea is that you have threads running on multiple
> hardware nodes, and they exchange messages.
Of course, Erlang is dynamically typed. By convention, the messages
exchanged are tuples, starting with an atom which identifies the type of
message.
The Haskell implementation does it differently, with two (incompatible)
methods of exchanging messages:
1. Every process implicitly has a "mailbox" that can be used to send or
receive messages of arbitrary [sendable] type. The "send" function sends
a message; the "receive" message waits for a message of the correct type
to arrive, and then returns that. Any messages of the wrong type stay
queued FIFO until an appropriate receive call is executed.
2. You can explicitly create typed "channels". Each such channel can
carry only one type of data, guaranteeing that the receiving end is able
to handle any type of message that you can send. There is also a
function for reading from multiple channels at once, possibly of
different types.
To me, the whole API looks a bit ad hoc and could do with tidying up a
bit. But the fundamental stuff seems to be in place...
Post a reply to this message
|
|