Files
hakorune/src/mir/join_ir_vm_bridge/README.md
nyash-codex 447bbec998 refactor(joinir): Split ast_lowerer and join_ir_vm_bridge into modules
ast_lowerer.rs → ast_lowerer/ (10 files):
- mod.rs: public surface + entry dispatch
- context.rs: ExtractCtx helpers
- expr.rs: expression-to-JoinIR extraction
- if_return.rs: simple if→Select lowering
- loop_patterns.rs: loop variants (simple/break/continue)
- read_quoted.rs: read_quoted_from lowering (Phase 45-46)
- nested_if.rs: NestedIfMerge lowering
- analysis.rs: loop if-var analysis + metadata helpers
- tests.rs: frontend lowering tests
- README.md: module documentation

join_ir_vm_bridge.rs → join_ir_vm_bridge/ (5 files):
- mod.rs: public surface + shared helpers
- convert.rs: JoinIR→MIR lowering
- runner.rs: VM execution entry (run_joinir_via_vm)
- meta.rs: experimental metadata-aware hooks
- tests.rs: bridge-specific unit tests
- README.md: module documentation

Benefits:
- Clear separation of concerns per pattern
- Easier navigation and maintenance
- Each file has single responsibility
- README documents module boundaries

Co-authored-by: ChatGPT <noreply@openai.com>

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 17:42:19 +09:00

939 B

JoinIR → VM bridge layer

Responsibilities:

  • Convert normalized JoinIR modules into MIR for the Rust VM without changing semantics.
  • Provide a thin runner helper that executes a JoinIR entry via the VM.
  • Host experimental metadata-aware paths (Phase 40-1) behind clearly marked helpers.

Boundaries:

  • No new control-flow semantics or heuristics here; this layer only maps structures already normalized by JoinIR.
  • Keep type information minimal (MirType::Unknown) and avoid adding inference or guessing.
  • Debug/diagnostic output must stay behind NYASH_JOINIR_VM_BRIDGE_DEBUG=1.

File layout:

  • mod.rs: public surface + shared helpers (naming, error, logging)
  • convert.rs: JoinIR→MIR lowering (functions/blocks/instructions)
  • runner.rs: VM execution entry (run_joinir_via_vm)
  • meta.rs: experimental metadata-aware conversion hooks
  • tests.rs: bridge-specific unit tests (kept local to avoid cross-layer leakage)