Erlang is embedded in C

I want to embed Erlang VM in C code ... I am familiar with ports related to drivers, etc. I want C to start the Erlang virtual machine and then pass messages to Erlang processes and pass those messages back to C code. I do not want erlang VM to be the first to start first, and then sometimes call the C code. I have reasons.
I know that this negatively affects the stability guarantees given by Erlang, which means that if the master code fails, it will also be destroyed by the Erlang VM, since they work in the same process. I want to live with these events ...

is it even possible?

Thank you

+6
c erlang
source share
2 answers

The only reasonable way to do this is to load C code from Erlang VM, and not vice versa.

This is not possible out of the box, but since you have access to the Erlang source, you can do whatever you want if you want to spend a lot of time modifying the code. This is not a good use of your time to go this route.

+2
source share

The easiest way is to simply start it as a separate process, and then use stdin and stdout for communication. Just by reading the documents of any platform that you are targeting, you will learn how to do this.

+3
source share

All Articles