2.2 KiB
2.2 KiB
Phase 20.10 — Migration Plan (Script‑First Runner)
Phases
- Runner Facade in Script (lang)
- Provide a thin Script Runner that orchestrates entry selection and delegates execution to current backends.
- Keep VM/LLVM selection in Rust; the script facade focuses on entry/args and pre/post hooks.
- Default: ON(opt‑out via
HAKO_SCRIPT_RUNNER=0|off|false)。 - Pre‑invoke emits stable short lines(stdout):
invoke/invoke: FAIL。 - UsingResolver probes:
HAKO_USING_RESOLVER_FRONT|COMPARE|SHADOW(挙動不変)。
- Extern/Effects SSOT(spec + generator; STRICT checks)
specs/externs.tomlを SSOT とし、dev ツールで Python/Rust に生成・同期。- Drift チェックは STRICT(ズレは FAIL)。
- Effects の取り込みは env ゲート(
HAKO_EXTERN_EFFECTS_SSOT=1→ Io を反映)。
- CLI/ENV Harmonize
- Add CLI flags (done in 20.9) and align HAKO_* first; ENV remains helper overrides.
- Document precedence: CLI > ENV > TOML. Provide quickref in docs/guides/env-variables.md.
- Extern via C‑ABI (policy flip under gate)
- Ensure all script‑visible externs lower to
hako_*(AOT) and forbid dotted C symbols in STRICT. - Gate: CI_STRICT=1 for dotted symbol check.
- Smokes & Parity
- Add representative integration-core parities (done: env.local.get exists/missing, console.warn/error).
- Add failure diagnostics (done: mir_emit_failed; have symbol_missing already).
- Add runner representative smokes(invoke/trace/workspace-only; quick + integration-core)。
- Rollback & Safety
- All new pieces are opt‑in by flags. Removing gates reverts to current behavior.
- Selfhost Launcher (AOT)
- Produce
lang/bin/hakorunevialang/build/build_runner.sh(LLVM18 dev)。 - Quick smoke builds and runs the launcher (exit code=0)。
- Final Goal(配布イメージ)
git/hakorune-selfhost/lang/bin/hakoruneを自己ホストバイナリとして常備。- CI(将来)で
lang/build/build_runner.shを build-only に組み込み、canary 実行で健康診断。
Notes
- Python backend remains as-is. This phase focuses on boundaries, contracts, and runner facade.
- Ref‑VM continues as a reference for semantics; production runs are Rust VM/LLVM.