01
Speak Elixir
Compile modules, functions, scalar expressions, selected terms, pattern matching, closures, and a deliberately bounded standard-library surface.
Batata · Experimental compiler
A small compiler with grand ambitions. Batata carries a practical slice of Elixir through MLIR to efficient native code.
def main, do: 6 * 7
%0 = arith.muli %6, %7
./main → 42
Small language. Grand performance.
01 / WHY BATATA
Batata explores what an Elixir-to-native pipeline looks like when every boundary is explicit: language subset, transformation, lowering, runtime ABI, and emitted artifact.
It is built with Beaver, the Slang-defined ex dialect, LLVM, and a compact Zig term runtime.
01
Compile modules, functions, scalar expressions, selected terms, pattern matching, closures, and a deliberately bounded standard-library surface.
02
Inspect the ex IR, information-preserving transforms, structured lowering, and the final LLVM representation.
03
Run through the MLIR JIT or emit an AOT static archive, C driver, symbol manifest, and digest-addressed export bundle.
02 / PIPELINE
Each stage has one job. Representation changes stay visible, unsupported forms fail explicitly, and semantic gates compare native results with a BEAM oracle.
ex dialecttyped compiler boundary03 / HONEST STATUS
Batata is active compiler research, not a drop-in BEAM replacement. The compatibility surface grows behind executable semantic gates.
04 / QUICKSTART
Batata currently targets compiler contributors and early experimenters. You will need Elixir, OTP, Zig 0.16, and an LLVM/MLIR toolchain.
Open development setup ↗# Clone the compiler and its local dependencies
git clone https://github.com/batata-lang/batata.git
git clone https://github.com/beaver-lodge/beaver.git
git clone https://github.com/beaver-lodge/kinda.git
cd batata
export BEAVER_PATH=../beaver
export BEAVER_KINDA_PATH=../kinda
mix deps.get
mix test
Built in the open
Read the compiler, test a language slice, or bring a precise unsupported case. Small, verifiable steps are the roadmap.