[erlang-questions] code mobility

Dmitry Vasiliev <>
Thu Oct 21 18:35:03 CEST 2010


21.10.2010 19:27, Jiansen He пишет:
> Thank you for your reply,
>
> code:load_binary/3 is what I used in one of my demo programs.  My code looks
> like this:
[skip]
> The above code will load client.beam to all nodes.  If I only want send
> client.beam to server, where the code is really executed, I can use
> rpc:call/4 instead.   There are two other trivial consideration in the above
> implementation.
>
> For one thing, I send the whole file to the server.  The function is sent
> with other irrelevant functions.
>
> For another thing, what if I want to send a complex function which employs
> functions from other modules?  Shall I know every details about the complex
> function and send involved files myself?  For example, isEven/1 is defined
> in E.erl and isOdd is defined in O.erl.  Both files are well documented
> because the functionality and usage of each function are clearly specified.
>   Programmers could use isEven and isOdd as APIs.  What users don't know (and
> don't need to know) is, how isOdd and isEven is implemented.

Maybe you need to take a look at erl_boot_server module or implement 
some "on demand" remote module loading yourself?

-- 
Dmitry Vasiliev <dima at hlabs.org>
http://hlabs.org
http://twitter.com/hdima


More information about the erlang-questions mailing list