How calling other languages from Elixir works ?
Does elixir/erlang interface badly with other languages (C++/ Go / C / Java … ) ?
Does it affect the the ability to use OTP’s capabilities ?
Interfacing works very well and you have plenty of options to do so.
Its best to read the Erlang guide to InterOp.
Its different from the FFI of many other languages where you often can call C-functions more or less directly…
- Strangely enough Jinterface is only mentioned in passing in the overview of the guide.
- Recently Erlang Solutions added Pyrlang.
- An older blog post about how to use ports to interact with Ruby The Erlangelist: Outside Elixir: running external programs with ports by @sasajuric.
Here is a good article on this for Elixir + Python: https://hackernoon.com/mixing-python-with-elixir-7a2b7ac6696
There’s too a great bridge to Rust that doesn’t crash the BEAM in case of failure: https://github.com/hansihe/rustler
Cnode is the best solution, that’s how I work with OpenCV (C++) from Elixir. There’s a certain amount of boilerplate code you have to write on both sides, but after that it’s very flexible, you can do anything you want without worrying about crashing Elixir side.
Interesting! Do you have an example regarding the boilerplate? Thanks for the source!
Is anyone using Apache Thrift (https://thrift.apache.org/) for their cross-language RPC? And if so, do you like it?