[erlang-questions] OOP in Erlang

Scott Lystig Fritchie fritchie@REDACTED
Wed Aug 11 18:35:10 CEST 2010


Jesper Louis Andersen <jesper.louis.andersen@REDACTED> wrote:

jls> [...] One problem of
jls> Erlangs memory model is that sending a large datastructure as a
jls> capability to another process, several megabytes in size, will mean
jls> a copy.

If I can add a pair of small but important points ... First, the
*semantics* require a copy.

jls> In the default VM setup that is.

Second, the implementation is free to do whatever it wishes as long as
it preserves the semantics.  Depending on how new you are to the Erlang
world, you may not know about the hybrid heap VM, which can avoid the
copy-between-processes behavior you mention above.  It is available, if
you specifically build for it ("./configure --enable-hybrid-heap") and
then start a VM using "erl -hybrid"(*).

To start hunting for research papers, ask a Web-search-gizmo about
"erlang hybrid heap" and/or "erlang shared heap".

Drifting farther afield, the Erjang implementation of Erlang has some
impressive speed gains by avoiding inter-process copying.

-Scott

(*) Odd, the "-hybrid" flag is no longer mentioned in the R13B04 "erl"
reference guide ... except an oblique mention vis a vis the "-smp" flag.
The hybrid heap isn't fully supported by Ericsson right now, IIRC, so
I'm not very surprised.


More information about the erlang-questions mailing list