[erlang-questions] code mobility

Rapsey rapsey@REDACTED
Thu Oct 21 07:29:08 CEST 2010


Why cant you have the same beam files on all nodes?


Sergej

On Thu, Oct 21, 2010 at 2:42 AM, Jiansen He <jiansenhe@REDACTED>wrote:

> Hello,
>
> I am thinking to what extend Erlang may support (weak) code mobility.
> Directly send a function to another node will not work because only
> function signatures are sent.  I tried sending functions in 3 ways:
>
> 1) send a string to a remote node, where a erlang interpreter is
> invoked.
> 2) get the representation of function by calling erlang:fun_info/1,
> send the representation, then reconstruct the function at remote node.
> 3) force the remote node loading the module where the function is
> contained, so that function could be called by its name.
>
> Notice that none of the above solutions are satisfactory if another
> helper function is needed.  If this is the case, then I have to send
> all potentially involving functions by hand.
>
> Could anyone offer a better solution to send a function in Erlang.
> Or, perhaps, some efforts have been done before?  I think code
> mobility will became more and more important for future languages.
>
> Jiansen
>


More information about the erlang-questions mailing list