v4 Capstone: full pipeline wiring
End-to-end stages
- Lex -> Parse -> Analyze -> Compile -> Encode -> Decode -> Link -> VM
Stage ownership
- front-end does not execute
- compiler does not interpret AST semantics
- VM runs bytecode only
- linker rewrites closure ids for merged space
Error ordering
- stop at first failed stage
- analyzer before encode/link/run
- decode failure before VM
Determinism
- preserve declaration order
- stable export/import order
- stable closure rebasing and init concatenation
Why encode/decode
- catch serializer drift early
- prove compiled output boundary
- simplify debugging
Practical checks
- same source -> same final output shape
- link errors happen before runtime
- runtime errors only after successful front-end + decode + link
1 / 1