Do Erlang BEAMS act like Java applet?

Matthias Lang matthias@REDACTED
Fri Sep 13 21:07:12 CEST 2002

Jilani Khaldi writes:

 > Having 2 computers A and B connected to the web and both are 
 > running Erlang. The computer B has somewhere (say in
 > "/usr/physics") an application called "magnetism.beam" which 
 > requires other "*.beam" to run and all these files 
 > are in "/usr/physics". 

 > Is it possible to run "magnetism.beam" on the Computer A 
 > (something like Java applet)? 


If A & B share filesystems, such as through NFS, then you don't need
to do anything apart from setting your code path.

If A & B are connected via distributed Erlang (or HTTP, for that
matter), it's reasonably straightforward, albeit fiddly:

    (b@REDACTED)3> {ok, Bin} = rpc:call(a@REDACTED, file, read_file, ["gth_log.beam"]).
    (b@REDACTED)4> code:load_binary(gth_log, "remote_file_gth_log", Bin).

(I only have one computer here, so my two nodes are on the same host,
but the method is identical for multiple hosts).

 > Is it possible to run it on B and have the output on A (something 
 > like X server)? Or combining both: calculations on B and 
 > visualization on A? 

You can divide your application across nodes any way you want. In
practice you'll be restricted a by what sort of user interface you

There's quite a bit of documentation to help you get started, for
instance the "getting started" guide has a quick introduction to
distributed Erlang:
another good source of information is the Erlang book, which you can
download from

it's a little out of date, but it's lies are mostly of the omission type.


More information about the erlang-questions mailing list