Lay of the Land

You may use three main strategies to integrate with external code. Each strategy has a different level of coupling. With the tightest coupling first, here they are:

  • Strategy 1: Your application can share the same memory address space. Think of it as a function running in the same OS process. You can load the external code inside the VM that is running your Elixir code. This is implemented in the Erlang VM using the so-called native implemented functions (NIFs).

  • Strategy 2: Your code can invoke the external code as a separate program on the same machine. Think of this strategy as a different OS process, but running on the same machine. In Elixir, we do so by using ports.

  • Strategy 3: You can communicate with the external code over ...

Get Adopting Elixir now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.