[erlang-questions] Erlang newbie questions

Gerry Weaver <>
Thu Oct 20 09:04:19 CEST 2011


 Hello All,


Thanks again for all of your valuable help and insight.




In consideration of the following:


...


1. have your native (IDE) application start a C node and use that to dispatch tasks to the external worker node(s)
2. start the emulator embedded from within your native application
3. fork an OS command to start erl in another node and talk over pipes and/or socket I/O using some binary protocol (like protocol buffers, BERT or Piqi)


...
Is there a library for embedding the Erlang VM inside a C program? I don't seem to be able to find a reference to anything like this. This would be very nice to have. I've been looking through the source code also, but I'm having some trouble locating the code in question. I'm interested in this due to the whole starting, stopping, and packaging thing. An interface like this would pretty much make those items a non-issue. It wouldn't need to be very fancy or complicated. Something like the following would be perfect.

init_vm
term_vm


add_path - add paths to search for beam files etc.


start_vm
stop_vm  


- or -


even just...


start_vm
stop_vm  


would suffice.


Note: It would seem unnecessary to call between Erlang/C code from here. It seems there are already reasonable facilities for doing that. I know there has been a lot of discussion about C and how it could compromise fault tolerance etc., but I don't see this as doing that. Particularly when one considers the current startup method. I would also be valuable to have the ability to start/stop/restart nodes remotely.


If a interface like this doesn't exist how hard would this be to do? It would also be much appreciated if someone could point me to the right place in the source tree to start looking into this. I've been doing some greps, but nothing is standing out. I'm left with the possibility of looking at all of the Makefiles to find where/how erl is built.




I am also a little hazy on what exactly is possible from a C node. I've read the doc, but I guess I lack the ability/experience at this point to understand the scope of the access it provides. Can you send commands and function calls to a remote node? Is this analogous to the erl shell (ie; any valid Erlang construct can be sent)?


Thanks,
-G 













-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111020/a3e7f2b1/attachment.html>


More information about the erlang-questions mailing list