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

33 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Plan — Phase 20.11
1) AOT 小ライブラリ + AotBox プラグイン(既定 ON: 小ライブラリopt-in: プラグイン)
- 小ライブラリlibhako_aotをコアに据え、AotBox プラグイン内部からも同APIを呼び出し共有コア
- AotBox: `compile/2`json→obj, `link/3`obj→exe。効果 Io。短文診断維持。
- CLI: `hakorune --emit-exe` は既定プロセス経路、小ライブラリ/プラグイン経路はゲートで選択将来FFIへ昇格
2) Runner → UsingResolver 決定フック(挙動不変)
- ゲート `HAKO_USING_DECISION_FROM_LANG=1` で ModuleFunction の結果JSON shapeを取得し runner で採用失敗はFailFast
- Rust 側は検証/整流に寄せ、二重決定を避ける(互換期間は警告のみ)。
3) 配布レイアウト・UX 整備
- bin/ はランチャOS委譲に限定、バイナリは target/ または dist/ に配置。
- dist/hakorune-<ver>-<os>-<arch>/{bin,lib,include,docs} をテンプレ化。
- CLI: `--emit-exe`(一発)+ `hako-aot compile/link`(段階)をガイド。
4) スモーク/CI 追加
- quick/llvm/aot_c_lib_compile_link_run.sh小ライブラリ
- quick/plugins/aot_plugin_compile_link_vm.shAotBox
- quick/core/using_resolver_decision_vm.shゲートONで短文観測
- run_local_checks に dist テンプレ shape チェックstrict=warn
5) LLVM Script BuilderHakorune スクリプト層・段階導入)
- 目標: Python llvmlite ハーネスを段階的に置換。まずは“最小命令”のIR構築をスクリプトで実装し、生成物は従来の ny-llvmc/リンカで処理。
- 境界: IR 構築のみ(箱化)。リンク/実行は既存の小ライブラリ/AotBoxが担当。FailFast未実装命令は `UNSUPPORTED`)。
- フォルダ: `lang/src/llvm_ir/`README + LAYER_GUARD/ `.../boxes/`Module/Function/Builder/Types/Emit
- ゲート: `HAKO_LLVM_SCRIPT_BUILDER=1`既定OFF、optin
- MVP緑の順:
- v0: const/binop/retexe = 0 を生成)→ スモーク2本const_ret / binop
- v1: compare/branch/phi簡易条件分岐
- v2: call/externhako_* のC-ABIのみ
- 受け入れ: 代表スモークPASS、ny-llvmc/ハーネス経路は既存のまま緑維持optinのみ影響