🔍 Investigation Results: - MIR builder correctly detects static box calls (trace confirmed) - Root cause: Callee::Method has receiver=Some(undefined ValueId) - VM has existing static box singleton path but unreachable 📊 Key Discovery (VM call dispatch analysis): - method.rs:16 - reg_load(receiver) fails for undefined ValueId - method.rs:138-146 - static box singleton path exists but requires receiver=None - Problem: MIR builder sets receiver=Some(...) even for static calls 📁 Files Added: - phase173-2_implementation_complete.md - Comprehensive investigation report - phase173-2_investigation_findings.md - Root cause analysis - phase173-2_completion_summary.md - Summary document 📁 Files Modified: - parser_box.hako - Added is_using_alias() helper - parser_expr_box.hako - Added static box call detection - CURRENT_TASK.md - Updated Phase 173 progress 🎯 Next Step (Phase 173-B): Fix unified_emitter.rs to set receiver=None for static box calls This will allow VM to reach existing static singleton path 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
Hakorune Compiler — Layout and Responsibilities
Structure (target)
- emit/
- mir_emitter_box.hako — high-level MIR emitter entry
- common/ — shared emit helpers (mir_emit/json_emit/call_emit/header_emit/newbox_emit)
- parser/ — lexer/parser (to be moved from apps/* in later steps)
- builder/, ssa/, rewrite/, pipeline_v2/ — existing compiler stages (move gradually)
Policy
- Compiler lives under
lang/src/compiler/. - VM engines live under
lang/src/vm/engines/(Hakorune/Mini), with shared helpers invm/boxes/. - Keep imports across these boundaries minimal and documented.
Grammar Notes (parser parity)
- Semicolons are accepted as optional statement separators (default ON).
- Both newline and
;delimit statements; trailing};is allowed. - Consecutive
;;are treated as empty statements (no-op). - Env toggle (opt-out): set
NYASH_PARSER_ALLOW_SEMICOLON=0|false|offto disable.
- Both newline and