A word of caution. I looked into embedding python some time ago, but you should be aware that the python interpreter state is all global. There’s only one interpreter in the entire program. So if you want to run a snippet of python over here, and a snippet over there, … Look out.
Anyway, ruby is exactly the same. There’s only one interpreter, so you need to be really careful about who gets to use it. I assume the elixir wrapper does some locking to prevent concurrent access, but it’s still this giant pile of mutable state that your otherwise functional program is messing with.
A word of caution. I looked into embedding python some time ago, but you should be aware that the python interpreter state is all global. There’s only one interpreter in the entire program. So if you want to run a snippet of python over here, and a snippet over there, … Look out.
Anyway, ruby is exactly the same. There’s only one interpreter, so you need to be really careful about who gets to use it. I assume the elixir wrapper does some locking to prevent concurrent access, but it’s still this giant pile of mutable state that your otherwise functional program is messing with.
You’re right about the perils of embedding of course, but AIUI ErlPort runs a normal Ruby (or Python) interpreter in a new OS process and communicates with it via stdio: https://github.com/hdima/erlport/blob/master/src/ruby.erl#L186