Files
hakorune/apps/selfhost/compiler
Selfhosting Dev 81211c22ad feat: MIR Call命令統一Phase 3.1-3.2完了!統一Call実装進行中
 Phase 3.1-3.2実装完了
- build_indirect_call_expressionでCallTarget::Value使用
- print関数をcall_global print()として統一
- build_function_callでemit_unified_call使用
- ExternCall(env.console.log)→Callee::Global(print)完全移行

🏗️ MIR統一基盤構築
- src/mir/definitions/call_unified.rs: 統一定義(297行)
- emit_unified_call()と便利メソッド3種実装
- NYASH_MIR_UNIFIED_CALL=1で段階移行制御
- VM実行器でCallee対応実装済み

📊 進捗状況(26%削減見込み)
- Phase 1-2:  基盤構築完了
- Phase 3.1-3.2:  基本関数統一完了
- Phase 3.3: 🔄 BoxCall統一中
- Phase 4: 📅 Python LLVM(最優先・63%削減)
- Phase 5: 📅 PyVM/VM統一

📚 ドキュメント更新
- CLAUDE.md: テストスクリプト参考集追加
- CURRENT_TASK.md: Phase 3進捗更新
- python-llvm-priority-rationale.md: 優先順位戦略文書化
- mir-call-unification-master-plan.md: スケジュール最新化

🎯 6種類→1種類: Call/BoxCall/PluginInvoke/ExternCall/NewBox/NewClosure → MirCall統一へ

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 01:05:44 +09:00
..

Nyash Selfhost Compiler (MVP scaffold)

This is the Phase 15.3 work-in-progress Nyash compiler implemented in Ny.

Layout

  • compiler.nyash: entry (CompilerBox). Reads tmp/ny_parser_input.ny, prints JSON v0.
  • parser/: lexer/parser/ast (scaffolds; to be filled as we extend Stage2)
  • mir/: builder/optimizer stubs (future; current target is JSON v0 emit)
  • tests/: Stage1/2 samples (TBD)

Run (behind flag)

  • NYASH_USE_NY_COMPILER=1 target/release/nyash --backend vm <program.nyash>
    • The runner writes the input to tmp/ny_parser_input.ny and invokes this program.
    • It captures a JSON v0 line from stdout and executes it via the JSON bridge.
    • Stage3 syntax gate: set NYASH_NY_COMPILER_STAGE3=1 to pass --stage3 to the parser (accepts Break/Continue/Throw/Try in JSON v0).

Notes

  • Early MVP emits a minimal JSON v0 (currently a placeholder: return 0). We will gradually wire lexer/parser/emitter.
  • Keep JSON v0 spec in docs/reference/ir/json_v0.md.