MEP-42 Backend Survey: Summary and Recommendation
Comparison table and Phase 1 / Phase 2 recommendation for Mochi's native code-generation backend.
16 notes
Comparison table and Phase 1 / Phase 2 recommendation for Mochi's native code-generation backend.
The "honorable mentions" beyond LLVM/Cranelift/MIR/QBE.
What it takes to write a valid ELF/Mach-O/COFF from a backend's raw bytes.
"Mochi → Wasm → wasmtime compile → native": skip the backend, use the wasm ecosystem.
"How small can a useful native backend be?"
The lowest-cognitive-load path: emit C, let GCC/Clang do the rest.
Multi-Level IR, dialect framework, the foundation under Mojo, IREE, and OpenXLA.
Go's internal assembler exported as a library, already used by Mochi's vm2jit.
Mike Pall's preprocessor-driven assembler with runtime patching; LuaJIT's secret weapon.
Stencil-based binary stitching from OOPSLA 2021, now shipping in CPython 3.13/3.14.
GCC as a shared library, used by Emacs native compilation, GCC Rust, GDC, Cython.
Vladimir Makarov's lightweight JIT+AOT, fast compile times, lazy basic-block versioning.
Quentin Carbonneaux's deliberately tiny SSA backend, "70% of LLVM in 10% of the code."
Bytecode Alliance's Rust-native SSA backend, ISLE-driven, ~10x faster compile than LLVM.
The workhorse SSA infrastructure, version 20 era, evaluated for MEP-42.
LLVM, Cranelift, QBE, MIR, libgccjit, copy-and-patch, DynASM, golang-asm, MLIR, C-as-target, TCC/chibicc, Wasmtime AOT, direct object emission, JIT library survey.