58 lines
3.0 KiB
Markdown
58 lines
3.0 KiB
Markdown
# Phase‑20.30 — Execution Plan (AOT Bring‑Up)
|
||
|
||
Milestones
|
||
|
||
1) AOT toolchain path (harness‑first)
|
||
- Choose ny‑llvmc harness for IR/object emission (no new Rust semantics).
|
||
- Contract: JSON v0 in, single main function out; numeric return maps to rc.
|
||
|
||
2) Runtime static lib (minimal)
|
||
- Provide `libhakorune_runtime.a` (C) with: console.{log|warn|error}, time.now_ms, mem.{alloc|free|name}, String helpers, Array minimal (size/get/set/pop), Map stub or plugin‑only guard.
|
||
- Document headers and ABI entrypoints; keep symbols stable.
|
||
|
||
3) Link step + wrapper
|
||
- Script `tools/hakorune/aot_build.sh` (dev) to: emit JSON → ny‑llvmc → link runtime → produce EXE.
|
||
- Env toggles: HAKO_AOT_RUNTIME_PATH, HAKO_AOT_LD_FLAGS (dev only).
|
||
|
||
4) Canaries
|
||
- AOT return/binop/if build+run; rc parity(return/binop=7, if=1)
|
||
- Negative: extern-missing(ビルド失敗 or 実行非0 を PASS とする), div by zero(ビルド失敗 or 実行非0 を PASS とする)
|
||
|
||
5) Docs + CLI glue (optional)
|
||
- Document AOT workflow and constraints; add `--aot` thin CLI delegator that shells out to script (dev only) without adding Rust semantics.
|
||
|
||
Success criteria
|
||
- End‑to‑end: hakorune‑frozen builds hakorune‑new (hello AOT) and tiny programs run.
|
||
- Rust freeze honored (no new runtime semantics implemented in Rust).
|
||
|
||
---
|
||
|
||
# Rust‑Freeze + Hako Engine Bring‑Up (P0/P1)
|
||
|
||
Objective
|
||
- 減速無しで「脱Rust」を段階導入。既存のRust実行層は凍結し、Hakorune側エンジン(Core/VM)を優先経路として増強する。
|
||
|
||
Scope(今回)
|
||
- P0(2週間): エンジン選択トグルと Gate‑C の既定化(ドキュメント)
|
||
- Runner に `--engine {rust|hakorune}` / `HAKO_VM_ENGINE=hakorune` を追加(既定OFF)。
|
||
- quick/integration-core の opt‑in カナリアで Hako エンジンを観測(Fail‑Fast 厳守)。
|
||
- Gate‑C(JSON→Core) を quick で第一候補として“明文化”。README/Smokes に記載。
|
||
|
||
- P1(3〜4週間): JSON 処理の Hako 側への薄移管
|
||
- 既存の `lang/src/vm/core/json_v0_reader.hako` を Gate‑B/C 境界で共通 reader として再利用。
|
||
- 最小 emitter(const/ret/binop)を Hako 側に追加し、Rust emit と opt‑in で並行運用。
|
||
- SSOT生成は現行 `tools/hakorune/gen_ssot.sh` を継続(失敗時は現行fallback)。
|
||
|
||
- P1'(並行 1週間): I/O Bridge の最小C‑ABI
|
||
- print/read_all など最小APIのみ(console/time/fsはゲートで制御)。
|
||
- Gate: `HAKO_KNI_{TIME|FS}=1` が無い場合は Fail‑Fast。
|
||
|
||
Acceptance
|
||
- quick/integration-core が両エンジン(rust/hakorune)で opt‑in 緑。
|
||
- Gate‑C 直行の file/pipe × plugins ON/OFF が対称(既存カナリアで担保)。
|
||
- AOT 代表(return/binop/if)を自走で生成・実行可能(既存 canary で担保)。
|
||
|
||
Notes
|
||
- plugin 依存ケースは preflight+トグル(SMOKES_ENABLE_PLUGINS_CANARY=1)で厳密にゲートする。
|
||
- 実行意味論の追加は Hako 側のみ。Rust は「橋・ローダ・Fail‑Fast」以外は凍結し、差分最小を維持する。
|