I'm looking to embed the Erlang VM into C code... Im familiar with ports, linkedin drivers, etc.
I want the C program to start the Erlang VM, and then pass messages to Erlang processes, and have those pass messages back to C code. I dont want the erlang VM to be the one that starts first and then invokes C code occasionally. I have my reasons.
I know that this negatively affects stability guarantees given by Erlang, meaning that when the master C code crashes it will taken down the Erlang VM also, since they're running in the same process. Im willing to live with those occurrences...
is this even possible?
The easiest way would be to just launch it as a separate process, and then use stdin and stdout to communicate. Just reading the docs of whatever platform you're targeting will let you know how to do that.
The only sane way to do this is to load the C code from the Erlang VM, not vice versa.
It's not possible out of the box, but since you have access to the Erlang source it's clearly possible to do whatever you want if you're willing to spend a lot of time modifying the code. It's not a good use of your time to go down this path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With