The Erlang Virtual Machine has, historically, provided three main options for interoperability with other languages and ecosystems, with different degrees of isolation. By Wojtek Mach.
he article discusses several ways Elixir can interact with other programming languages and environments beyond the Erlang VM, emphasizing new advancements in interoperability. It highlights that traditional methods (NIFs, Ports, Distributed Nodes) each have trade-offs, and a shift towards portability opens new possibilities.
The article focuses on new emerging paradigm: portability. This involves running Elixir code in other environments, targeting their native capabilities.
Two key projects driving this are:
- AtomVM: A lightweight Erlang VM implementation, designed for resource-constrained environments like microcontrollers (ESP32, STM32). This opens doors for embedding Elixir into IoT devices. AtomVM also targets WebAssembly (WASM).
- Popcorn: A library leveraging WASM to run Elixir code directly in web browsers. This allows for interactive Elixir applications within a browser and JS interoperability, as demonstrated with a simple example of updating the browser’s content.
Increased flexibility to leverage existing libraries from other languages. The ability to run Elixir code in new environments like embedded systems or client-side web applications. Simplified development of full-stack web applications utilizing a single language (Elixir) throughout the stack. Improved performance through portability solutions targeting specific hardware or runtimes. Good read!
[Read More]