Introduction to Integrating with External Code
Explore how to integrate Elixir with external libraries and code through three key strategies: native implemented functions for tight memory sharing, ports for separate OS processes, and distributed protocols for network communication. Understand the trade-offs and practical uses for extending Elixir’s capabilities.
Some constraints on Elixir
So far we have been talking about scenarios where Elixir and the Erlang VM really shine. The combination of a couple of years of explosive growth and Erlang’s decades’ long history will serve us well when we need to integrate with the tens of thousands of available packages and libraries written in both Erlang and Elixir.
Elixir has its limitations, though. Here are a few of them:
-
Serious math statistical libraries
Such libraries and the like can be slow because the VM was not designed for number crunching. If the application depends on computing statistics, executing numerical methods, or finances, the VM may seem lacking.
-
Solutions built on top of matrices
The naïve implementation of matrices in Elixir would use lists of lists, which are not an ...