A common interoperability situation is when there exists a piece of code solving some complex problem, and we would like to incorporate this piece of code in our Erlang program. Suppose for example we have the following C functions that we would like to be able to call from Erlang.
(For the sake of keeping the example as simple as possible, the functions are not very complicated in this case).
Preferably we would like to able to call
% Erlang code ... Res = complex:foo(X), ...
The communication with C is hidden in the implementation of