Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

OK, in Haskell, data is immutable. If you want to pass data from one thread to another, there is no point in serializing it, sending it between threads and then deserializing it. You can just pass a reference. The data is also not typed, but that is potentially something you could fix in the bindings.

I know that in Erlang, you do pass data by exchanging blobs, but the difference is that Erlang has per Erlang-process heaps. Haskell has one heap, so there is no reason to do this.

It comes down to this, the way that you communicate between threads in the same process is different than the way that you communicated between processes.

> Are threads in Haskell not asynchronous by nature? Do you get synchronization for free somehow?

I'm not talking about what's happening underneath. I'm talking about the style that code is written in. I suppose, I could use a coroutine style monad over ZMQ's asynchronous API and create pseudo-threads, but they wouldn't get pre-empted, so you'd have to be careful to ensure that they didn't stave.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: