|
Re: Cedric Beust's Verdict on Erlang
|
Posted: Oct 5, 2007 2:03 PM
|
|
> > > Erlang makes all variables > > > immutable and adds an inbox to each process (and by > > > virtue of being a queue should not be a performance > > > problem for most cases). > > > > Is my description above fairly accurate? > > James, I have to confess I am no Erlang expert having only > read the online documentation and played around with a few > examples. I am extrapolating from having used immutable > values and queues on Java in threaded programs to good > effect.
Having written an Erlang "emulator" for Python (http://candygram.sourceforge.net), I feel somewhat qualified to answer. Your descriptions are basically accurate. One point that hasn't been noted is that it is possible to link processes together as peers, so that if one process dies the others are either notified or killed, depending on the nature of the link. This is why people tout Erlang's fault-tolerance.
Also, the interface to a local process is exactly the same as the interface to a remote distributed process, which is why it is easier to scale an Erlang system. Though, in practice, you usually have to be careful to keep track of where processes are located so that you don't waste time sending a lot of transactions to a remote process.
I unfortunately have no knowledge about how well a single queue will scale. I've never tried to slam one with millions of simultaneous messages. I suspect that the CPU, memory, or network would become saturated before the queue's lock would.
As an aside, I have largely abandoned my "emulator" since the impedance mismatch between Erlang and Python is too high. Python values are not typically immutable (i.e., lists, dicts, and sets) and Python has little facility for pattern matching on incoming messages. In fact, using the dynamic dispatch of method calls is a much more natural way to process messages in Python, which is why I've lately been using an actor model in Python instead.
|
|