A BEAM virtual machine. Written in Rust.
Not a port, not a binding, not an FFI bridge. A ground-up implementation of the BEAM execution model — preemptive scheduling, per-process GC, supervision trees, fault isolation — compiled to a single binary.
What is Beamr
A virtual machine — the engine that runs all the code in our stack. Think of it as the foundation everything else is built on. Where the standard BEAM runs Erlang and Elixir, Beamr is built from the ground up in Rust to run Gleam.
The scope constraint that makes it work
Gleam uses roughly 40 of the BEAM's 170+ opcodes. It generates predictable, well-structured bytecode — no dynamic code loading, no hot code swapping, no parse transforms. Beamr targets that subset precisely. This is the decision that makes the project tractable where previous attempts at a full Erlang/OTP VM stalled.
Gleam is fully type-checked at compile time, but compiles to dynamically-typed BEAM bytecode — the types are thrown away before execution. The real BEAM cannot recover them. Beamr keeps them and exploits them in the JIT: unboxed integers where type is proven, elided runtime guards, devirtualised calls. Beamr exploits Gleam's types for optimisations the real BEAM cannot make.
What shipped
JIT compilation
Cranelift-backed JIT with hot-function profiling and type-directed compilation. Beamr exploits Gleam's compile-time types that the real BEAM throws away.
Local cross-process send
The unlock that makes GenServer, Supervisor, and the entire OTP pattern library viable. Real PIDs, real mailboxes, real links and monitors.
Native process API
Rust structs as first-class scheduler-supervised processes. The bridge between Rust performance and BEAM concurrency.
Distribution layer
OTP 23+ handshake over real TCP. Cross-node primitives tested across Beamr nodes. Erlang cluster interop on the roadmap.
What's next
Full Elixir compatibility before v1.0. The distribution protocol is the foundation — already shipping. The AOT north star: whole-program ahead-of-time compilation to a single, tiny native binary with no VM to install. And the browser: OTP in WASM, LiveView without the latency, offline-first for free.
Apache-2.0 licensed. View on GitHub →