Files
hakorune/lang/src/runner
nyash-codex 7ca7f646de Phase 25.1b: Step2完了(FuncBodyBasicLowerBox導入)
Step2実装内容:
- FuncBodyBasicLowerBox導入(defs専用下請けモジュール)
- _try_lower_local_if_return実装(Local+単純if)
- _inline_local_ints実装(軽い正規化)
- minimal lowers統合(Return/BinOp/IfCompare/MethodArray系)

Fail-Fast体制確立:
- MirBuilderBox: defs_onlyでも必ずタグ出力
- [builder/selfhost-first:unsupported:defs_only]
- [builder/selfhost-first:unsupported:no_match]

Phase構造整備:
- Phase 25.1b README新設(Step0-3計画)
- Phase 25.2b README新設(次期計画)
- UsingResolverBox追加(using system対応準備)

スモークテスト:
- stage1_launcher_program_to_mir_canary_vm.sh追加

Next: Step3 LoopForm対応

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-15 22:32:13 +09:00
..

Runner Facade / Stage1 CLI — Runner Layer Guide

Responsibility

  • Provide script-side orchestration primitives for execution:
    • Runner facade (runner_facade.hako) for entry selection and pre/post hooks.
    • Stage1 CLI launcher (launcher.hako) for top-level command dispatch.
  • Delegate actual execution to existing backendsRust VM / LLVM / ny-llvmc。既定挙動は変えない。

Files

  • runner_facade.hako

    • Contractdraft:
      • Entry: Runner.run(entry: string, args: array<string>) -> i64
      • Gate: HAKO_SCRIPT_RUNNER=1default OFF
    • Role:
      • Script-first runner facadePhase 20.10)。
      • Pre-hooks: validate entry/args, emit short diagnostics。
      • Post-hooks: normalize result / metrics将来
    • Notes:
      • Keep this layer pure; platform I/O は C-ABI 側に委譲。
      • Fail-Fast: invalid entry/args は非0で即終了。
      • Short diagnostics:
        • Success: [script-runner] invoke
        • Failure: [script-runner] invoke: FAIL
  • launcher.hako

    • Contractdraft:
      • Entry: Main.main(args: array<string>) -> i64
      • Role: Stage1 hakorune CLI のトップレベル dispatcher。
        • コマンド: run / build / emit / check(詳細は docs/development/runtime/cli-hakorune-stage1.md
    • Current statusPhase 25.1:
      • 構造のみ実装(HakoCli box にコマンド別のメソッドを定義)。
      • 各コマンドはまだプレースホルダで、"[hakorune] <cmd>: not implemented yet" を出力して終了コード 9093 を返す。
      • 実際のパイプラインStageB / MirBuilder / AotPrep / ny-llvmc など)への接続は後続フェーズで段階的に実装する。
    • Design reference:
      • docs/development/runtime/cli-hakorune-stage1.md を Stage1 CLI の仕様 SSOT として参照すること。

Notes

  • Runner 層は「構造とオーケストレーション専用レイヤ」として扱う。
    • 言語意味論・最適化ロジックは compiler / opt / AotPrep に留める。
    • VM/LLVM の実行コアは Rust 側Stage0 / NyRTに委譲する。
  • Fail-Fast 原則:
    • 未実装コマンドや不正な引数は明示的なメッセージ非0終了コードで返す。
    • 暗黙のフォールバックや静かな無視は行わない。