Static copy
Copied from docs/en/decisions/adp-013.md in https://github.com/poppy-team/aipo-lang (MIT). Pinned to revision ce47c4e070404fc41722ccd8e2b7b808b99062a8, blob a2ccd3faf7338b7271c5fd62df6771ae5763c916. The source repository remains canonical; this copy is refreshed through a sync pull request, not live.
During the development of the v0.1.0 release of the Aipo programming language, deep bytecode interpreter optimizations were implemented and empirically measured (P1 Value layout compaction, P2 zero-alloc struct method dispatch, P4 superinstructions GetLocal0..7 & Call0..4, and E1 typed structured failures).
Despite significant gains measured in paired benchmarks (up to -13.94% CPU reduction), hardware microarchitectural analysis proved the existence of a physical dispatch floor of ~100ns per opcode in the stack-based interpreter (Stack VM):
match opcode) in safe Rust causes a branch misprediction rate exceeding 60%, costing 15 to 20 clock cycles of pure pipeline flush penalty per executed instruction.aipo-vm), along with the C ABI (aipo-c-abi), test runner (aipo test), and all 506+ green tests, is formally frozen on branch legacy/v0.1.0-stack-vm and tagged as v0.1.0-stack-vm-final..wasm module, executed with near-native performance via Wasmtime's JIT (powered by Cranelift) on desktop/server, and executed natively in browsers and JavaScript engines (Node.js, Deno, Bun, Cloudflare Workers).aipo-source (source mapping, spans, and locations).aipo-diagnostics (error codes, severity, and reporting).aipo-lexer and aipo-syntax (tokens, parser, and abstract syntax tree).aipo-hir and aipo-sema (type checking, scopes, interface contracts, and semantics).aipo-ir) aipo-ir is adapted to produce Structured Control Flow (block, loop, if ... else, br, br_if, br_table), eliminating arbitrary jumps in favor of a representation matching WebAssembly's formal model.aipo-wasm Backend aipo-bytecode (proprietary .aibc format) is succeeded by the aipo-wasm crate.aipo-wasm directly generates standard .wasm binary files using the pure Rust, high-performance wasm-encoder crate.aipo-host and WASI CapabilitySet, deny-by-default) maps cleanly to the capability model of WASI (WebAssembly System Interface) and the Wasm Component Model, ensuring strict isolation and execution security..wasm modules executed via Wasmtime integrated into the CLI.aipo-in-aipo), leveraging native data types (Bytes, List, Dict, Struct).aipo-compiler.wasm. From this point forward, the compiler is fully self-hosted and verified via bit-for-bit identity checks..wasm binary runs identically in the terminal, on the web, in serverless environments, and in native engines (such as Poppy)..wasm binaries from Aipo requires zero C-ABI bridges or low-level library dependencies.aipo-js transitions from a complex source transpiler into a native Wasm module loader.aipo-ir (Relooper/Stackifier).