Skip to main content

Crate monkey_asm

Crate monkey_asm 

Source
Expand description

AOT arm64 (AArch64) assembly backend for Monkey.

Design: docs/arm64-asm-backend-design.md. The crate is built twice: the host build exposes emitter/lower (pure functions producing .s text) plus the shared runtime_core; the aarch64 cross build additionally provides the extern "C" runtime the generated assembly links against.

Modules§

emitter
AArch64 text emitter (design §6): buffers, labels, span stack, and the encoding-limit helpers (load_imm64, frame/sp/global addressing) that lower.rs must never bypass.
lower
Single-pass AST → AArch64 lowering (design §6, §7): accumulator in x0, temporaries on the machine stack, scope analysis via the bytecode compiler’s SymbolTable, and every dynamic operation through the frozen rt_* ABI. No IR, no register allocation, no optimization.
runtime
Native extern "C" runtime the generated .s links against (design §8).
runtime_backend
Storage backends behind the runtime semantics (design §8.1).
runtime_core
Storage/execution agnostic runtime semantics (design §5.2, §8, §10.1).