tags:

views:

871

answers:

4

Erlang is getting a reputation for being untouchable at handling a large volume of messages and requests. I haven't had time to download and try to get inside Mr. Erlang's understanding of switching theory... so I'm wondering if someone can teach me (or point to a good instructional site.)

Say as a thought-experiment I wanted to port the Erlang ejabberd to a combination of Python and C, in a way that gave me the same speed and scalability. What structures or patterns would I have to understand and implement? (Does Python's Twisted already do this?)

+10  A: 

http://stackoverflow.com/questions/474497/how-why-do-functional-languages-specifically-erlang-scale-well/474530#474530 (for discussion of why)

http://erlang.org/course/course.html (for a tutorial chain)

As far as porting to other languages, a message passing system would be easy to do in most modern languages. Getting the functional style can be done in Python easily enough, although you wouldn't get the internal dispatching features of Erlang "for free". Stackless Python can replicate much of Erlang's concurrency features, although I can't speak to details as I haven't used it much. If does appear to be much more "explicit" (in that it requires you to define the concurrency in code in places that Erlang's design will allow concurrency to happen internally).

Godeke
Oops! thanks! That's a big help. I'm surprised that SO's duplicate question checker didn't lead me to that one.
Jim Carroll
+3  A: 

Erlang is not only about scalability but mostly about

  • reliability
  • soft real-time characteristics (enabled by soft real-time GC which is possible because immutability [no cycles] and share nothing and so)
  • performance in concurrent tasks (cheap task switch, cheap process spawn, actors model, ...)
  • scalability - debatable in current state , but rapidly evolving (about 32 cores well, it is better than most competitors but should be better in near future).
Hynek -Pichi- Vychodil
A: 

Another of the features of erlang that have an impact on scalability is the the lightweight cheap processes. Since processes have so little overhead erlang can spawn far more of them than most other languages. You get more bang for your buck with erlang processes than many other languages give you.

Jeremy Wall
A: 

I think the best choice for Erlang is Network bound applications - makes communication much simpler between nodes and things like heartbeat monitoring, auto restart using supervisor are built into OTP.

Bharani