Files
hakorune/docs/private/roadmap/phases/phase-20.10/PLAN.md

2.2 KiB
Raw Blame History

Phase 20.10 — Migration Plan (ScriptFirst Runner)

Phases

  1. 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: ONoptout via HAKO_SCRIPT_RUNNER=0|off|false)。
  • Preinvoke emits stable short linesstdout: invoke / invoke: FAIL
  • UsingResolver probes: HAKO_USING_RESOLVER_FRONT|COMPARE|SHADOW(挙動不変)。
  1. Extern/Effects SSOTspec + generator; STRICT checks
  • specs/externs.toml を SSOT とし、dev ツールで Python/Rust に生成・同期。
  • Drift チェックは STRICTズレは FAIL
  • Effects の取り込みは env ゲート(HAKO_EXTERN_EFFECTS_SSOT=1 → Io を反映)。
  1. 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.
  1. Extern via CABI (policy flip under gate)
  • Ensure all scriptvisible externs lower to hako_* (AOT) and forbid dotted C symbols in STRICT.
  • Gate: CI_STRICT=1 for dotted symbol check.
  1. 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 smokesinvoke/trace/workspace-only; quick + integration-core
  1. Rollback & Safety
  • All new pieces are optin by flags. Removing gates reverts to current behavior.
  1. Selfhost Launcher (AOT)
  • Produce lang/bin/hakorune via lang/build/build_runner.shLLVM18 dev
  • Quick smoke builds and runs the launcher (exit code=0)。
  1. 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.
  • RefVM continues as a reference for semantics; production runs are Rust VM/LLVM.