40 lines
2.5 KiB
Markdown
40 lines
2.5 KiB
Markdown
# Phase‑20.29 — Rust Freeze Baseline + Self‑Host Loop
|
||
|
||
Purpose
|
||
- Freeze the Rust layer to thin I/O + entry glue, and move day‑to‑day development into lang (Core/Builder). Establish a minimal, repeatable “Go‑style” self‑host loop: Hakorune compiles Hakorune.
|
||
|
||
In‑scope
|
||
- Runner defaults (dev/quick) prefer Gate‑C(JSON→Core). NyVM wrapper remains opt‑in.
|
||
- Rust layer freeze policy documented and enforced (allow: glue/ENV/bugfix; deny: new semantics/ops).
|
||
- Self‑host bootstrap: lang compiler emits JSON v0; Gate‑C executes; loop stable under canaries.
|
||
- SSOT exposure: generate/consume call SSOT from lang; Rust consumes outputs (no hand‑copy).
|
||
|
||
Out‑of‑scope
|
||
- Full stdlib or wide plugin semantics; focus on the minimal loop and boundaries.
|
||
- Performance work beyond correctness/Fail‑Fast.
|
||
|
||
Deliverables
|
||
- Green quick/integration-core with dev default = Gate-C(Core).
|
||
- Freeze policy doc + toggles noted in env guide.
|
||
- Self-host “compile tiny → JSON → Core → result” canaries always green.
|
||
- SSOT flow: lang → generated table → Rust (read-only use).
|
||
|
||
References
|
||
- docs/development/architecture/rust-freeze-policy.md
|
||
- docs/development/architecture/ssot-lang-gen.md
|
||
|
||
## Progress — 2025-10-31
|
||
- Gate-C(Core) is the default path for quick/dev; NYVM wrapper remains opt-in.
|
||
- Lang-side Core normalizer now rewrites all blocks/functions (String length/indexOf/lastIndexOf/substring/charAt/replace) and inserts missing `entry` ids.
|
||
- MIR(JSON) reader honours first block id when `entry` is omitted, fixing Gate-C “unterminated block” failures.
|
||
- Minimal Hako emitter provides `emit_if_eq_i64`/`emit_if_ne_i64`; canary (`hako_min_emitter_if_eq_vm.sh`) passes via Gate-C(Core).
|
||
- Core canaries extended (`core_lang_normalize_string_indexof_from_vm.sh`, `core_lang_normalize_string_lastindexof_vm.sh`) and documented in tools/smokes/v2/README.md.
|
||
- Hako emitter canaries now run on curated JSON fixtures (`if_ne`, `phi_diamond`) with an SSA validator to guard definition/usage consistency.
|
||
|
||
## Remaining Work
|
||
- Normalize optional/bang flags for String indexOf/find family; extend canaries for failure semantics.
|
||
- Harden `_read_args_digits` and related JSON scanners against whitespace/empty-list quirks (consider tokenizer helper).
|
||
- Consolidate Gate-C env helpers (some inline env writes remain in `pipe_io.rs`); ensure plugin=OFF paths stay minimal.
|
||
- Add additional Hako emitter canaries (if-ne + phi diamond) and JSON SSA validators.
|
||
- Re-run quick/integration-core after helper consolidation and promote canaries once stable.
|