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

Yes, it won’t always keep you safe from data races as Erlang will, but Erlang keeps you safe by copying your data over and over, making it significantly slower, TANSTAAFL.

Potshot. Defend it at your peril.



Erlang processes are shared-nothing and, by design, data must be copied when processes communicate:

> All data in messages between Erlang processes is copied, with the exception of refc binaries on the same Erlang node. [1]

But I have to agree with you that the paragraph about Erlang in the article overstates the issue. In most cases, messages should be relatively light and then the copy is not issue. It's an issue only when you need to transfer or share a complex data structure.

If I'm not mistaken, in the current implementation of BEAM, each lightweight process has its own heap and this is the reason why data must be copied. But it could be possible to allocate memory from an arena shared by all processes, and because Erlang data structures are immutable, messages exchanged by processes could contain only references. The cost would be a more complex garbage collector, with the related latency issues.

[1] http://www.erlang.org/doc/efficiency_guide/processes.html




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

Search: