3 ms·
> That's a fairly bold claim. I don't know seem true and practical to me. The industry (WhatsApp, Riak, CouchDB, RabbitMQ) and chances are, even your smart pho
by rdtsc 12y ago
> That's a fairly bold claim.
I don't know seem true and practical to me. The industry (WhatsApp, Riak, CouchDB, RabbitMQ) and chances are, even your smart phones disagree with you. They are many other closed source applications in the industry that reliably handle concurrency using Erlang.
> I suspect you could emulate Erlang actors
No you can't unless you run in an isolated heap and add a many years battle tested VM system and libraries built for concurrency and fault tolerance.
Otherwise yes, anyone can make a thread work with thread-safe queue -- look Erlang! Nope. Not Erlang. It is a fork-join or just a plain thread+queue.
> It's not an all-around winner in concurrency.
Yes it is. The winner in concurrency is system that has most fault tolerance tooling built in. That is true secret. "Millions of concurrent" threads are useless if the crash of one brings down the rest.
- wyager 12y ago>unless you run in an isolated heap Yes, Haskell already has per-OS-thread heaps, and there's not really any need for isolation since everything is immutable and GCed anyway. >many years battle tested VM system The VM is an implementation detail, not a feature. But yes, the GHC RTS is basically a VM. >libraries built for concurrency and fault tolerance Yes, Haskell has those. Specifically, libraries work no matter how they're being executed (concurrently or otherwise), and they're fault tolerant in the sense that error conditions are encapsulated in the type system and the libraries do not generally crash. >It is a fork-join or just a plain thread+queue. Well, not necessarily. I can express an actor however I want. Haskell forks aren't like regular C forks; they're much more flexible. It's basically the same thing as Actors in Erlang. The thread only gets picked up when something happens to a resource it's waiting on (like actors in Erlang). >The winner in concurrency is system that has most fault tolerance tooling built in. Well, Haskell has excellent fault tolerance support, but the recommended programming style is just to never crash, which is an entirely reasonable request when you're writing in Haskell. >"Millions of concurrent" threads are useless if the crash of one brings down the rest. There's no particular reason it would. See the `catch`, `handle`, etc. combinators for how to deal with errors in Haskell (although again, it's recommended just to write programs that don't crash).