restore(lang): full lang tree from ff3ef452 (306 files) — compiler, vm, shared, runner, c-abi, etc.\n\n- Restores lang/ directory (files≈306, dirs≈64) as per historical branch with selfhost sources\n- Keeps our recent parser index changes in compiler/* (merged clean by checkout)\n- Unblocks selfhost development and documentation references

This commit is contained in:
nyash-codex
2025-10-31 20:45:46 +09:00
parent dbc285f2b1
commit e5f697eb22
244 changed files with 16915 additions and 47 deletions

17
lang/src/opt/readme.md Normal file
View File

@ -0,0 +1,17 @@
# selfhost/opt — Optimization/Preparation Boxes
Purpose
- Provide small, opt-in preparation/optimization stages implemented in Hakorune.
- First step: AotPrepBox — MIR(JSON) normalize + safe local const-fold for single-block const/binop/ret.
Responsibilities
- JSON normalization via shared MirIoBox (canonicalization hook).
- Behavior-preserving, local transforms only; FailFast for unsupported shapes.
Non-Responsibilities
- Global CFG rewrites, SSA rebuild, or MIR semantics changes.
Gates
- Runner uses HAKO_AOT_PREP=1 to save “prepared” MIR sidecar after emitexe.
- Later we may switch compile input behind a dedicated flag once stable.