On Erlang, concurrency, parallelism and Haskell

Disclaimer

Please note that I have zero experience in Haskell, so these statements are all assumptions based on an afternoon of study. I will probably prove myself wrong pretty soon.

#Intro

This is a series of tweets that I consider interesting for future reference, so I decided to put them in a blog post:

Answer

Remark: I initially included the original tweets, but this was unreadable, so I now just show the lines; they are clickable to get the original tweet:

Clarification: by “Atom”, I mean the smallest possible part that can be split on a single thread; in Erlang these are processes, in Haskell these are sparks (i.e. function calls.)

Summary

In Erlang, the smallest parallelizable unit is a process, while in Haskell, a function call (aka spark) can be, because function calls can share immutable state over several processes, so it has the best of both worlds.

A big plus on the Erlang side of things however, is the “Let it crash approach”, and while the probability for bugs might be way lower due the type system, a bug might still occur, and that is actually one of the strengths of the Erlang/OTP system: it requires no defensive programming at all.

The educated guess is that, as the numbers of processors goes up, the requirement for having a language that offers true parallelism (like Haskell) might actually win…

So we still think that at this moment Erlang is the best choice, but in the future our bets would be on Haskell or similar tools.

Update

Looks like I have some more reading to do: