Execution stack responsibilities
High-level structure
Section titled “High-level structure”- Parsing (AST)
- HIR (semantic IR)
- CLIF lowering
- Module layer
- Execution backend (JIT thin / AOT primary)
- Runtime/stdlib
Suggested responsibilities
Section titled “Suggested responsibilities”beskid_analysis
Section titled “beskid_analysis”- Parser + AST + source spans
- HIR lowering + type checking
- Semantic analysis rules + diagnostics
beskid_codegen
Section titled “beskid_codegen”- HIR -> CLIF lowering
- FunctionBuilder integration
- Module abstraction (common for JIT/AOT)
beskid_runtime
Section titled “beskid_runtime”- Builtins + allocation
- String/array primitives
- Panic/error handling
beskid_engine
Section titled “beskid_engine”- JIT thin driver / execution API (development-time)
beskid_aot
Section titled “beskid_aot”- AOT object emission and linker orchestration (production path)
- Runtime archive preparation and ABI/version validation
Artifact handoff boundaries
Section titled “Artifact handoff boundaries”beskid_analysisoutputs resolved, typed semantic data.beskid_codegenconsumes semantic data and outputs lowered backend artifact(s).beskid_engineconsumes lowered artifacts for in-memory execution only.beskid_aotconsumes lowered artifacts for object emission and final linkage.beskid_runtimeimplements runtime ABI entrypoints used by both backends.
Forbidden coupling
Section titled “Forbidden coupling”beskid_analysismust not depend on runtime or linker behavior.beskid_codegenmust not encode backend-specific syscall policy.beskid_enginemust not define production packaging behavior.beskid_aotmust not redefine runtime ABI semantics.beskid_runtimemust not own language-level parsing/type semantics.
Why this split
Section titled “Why this split”- Keeps analysis and execution concerns isolated.
- Avoids mixing runtime with analysis.
- Keeps JIT and AOT as backend variants over the same lowering + runtime ABI.
- Ensures platform-specific execution policy lives in runtime, not in backend drivers.
Expansion plan
Section titled “Expansion plan”- Start with minimal HIR + CLIF lowering for functions and literals.
- Introduce runtime builtins for strings/arrays.
- Keep JIT narrow as a fast feedback harness.
- Grow production capability through AOT and runtime ABI hardening.