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:
8
lang/src/tools/loader_front/LAYER_GUARD.hako
Normal file
8
lang/src/tools/loader_front/LAYER_GUARD.hako
Normal file
@ -0,0 +1,8 @@
|
||||
#![doc = "Phase 20.13 loader_front guard — define layer responsibilities."]
|
||||
|
||||
static box LOADER_FRONT_GUARD {
|
||||
name() { return "loader_front" }
|
||||
allowed_imports() { return ["json", "env"] }
|
||||
forbidden_imports() { return ["vm_core", "plugins", "ffi"] }
|
||||
}
|
||||
|
||||
27
lang/src/tools/loader_front/README.md
Normal file
27
lang/src/tools/loader_front/README.md
Normal file
@ -0,0 +1,27 @@
|
||||
# loader_front — Loader Front EXE (Phase 20.13)
|
||||
|
||||
Purpose
|
||||
- Decide high-level loading (policy/allowlist/resolution) ahead of kernel loader.
|
||||
- Output a short, stable verdict; kernel honors it strictly (no fallback).
|
||||
|
||||
Responsibilities
|
||||
- Evaluate env/policy and candidate modules.
|
||||
- Emit: OK/NOOP/FAIL (tagged), exit code semantics same as runner_front.
|
||||
|
||||
Inputs/Outputs
|
||||
- Input: JSON/CLI with policy keys and candidates
|
||||
- Output: one-line verdict (short) + exit code
|
||||
|
||||
ENV (planned; default OFF)
|
||||
- HAKO_LOADER_USE_SCRIPT_EXE=1 (alias NYASH_*) — enable loader front EXE
|
||||
- HAKO_QUIET=1 — quiet mode adherence
|
||||
|
||||
Non‑Goals
|
||||
- No filesystem/ABI side-effects beyond read-only inspection.
|
||||
|
||||
TTL
|
||||
- Diagnostics/formatting migrates from Rust boundary to this front EXE when stable.
|
||||
|
||||
Notes (AOT / Single‑EXE)
|
||||
- 将来的に単一exeに内蔵(AOT)され、ENV反映→通常ロード継続を同一プロセスで行います。
|
||||
- 開発時は tools/front_exe/loader_front.sh をゲートONで差し替え可能です。
|
||||
8
lang/src/tools/runner_front/LAYER_GUARD.hako
Normal file
8
lang/src/tools/runner_front/LAYER_GUARD.hako
Normal file
@ -0,0 +1,8 @@
|
||||
#![doc = "Phase 20.13 runner_front guard — define layer responsibilities."]
|
||||
|
||||
static box RUNNER_FRONT_GUARD {
|
||||
name() { return "runner_front" }
|
||||
allowed_imports() { return ["json", "cli", "env"] }
|
||||
forbidden_imports() { return ["vm_core", "llvm", "plugins"] }
|
||||
}
|
||||
|
||||
32
lang/src/tools/runner_front/README.md
Normal file
32
lang/src/tools/runner_front/README.md
Normal file
@ -0,0 +1,32 @@
|
||||
# runner_front — Script-built Front EXE (Phase 20.13)
|
||||
|
||||
Purpose
|
||||
- Decide runner mode and normalize inputs before core execution.
|
||||
- Replace Rust-side front logic via a thin, testable EXE (AOT built from Hakorune scripts).
|
||||
|
||||
Notes (AOT / Single‑EXE)
|
||||
- 本モジュールは将来、単一の hakorune.exe に内蔵(AOT)され、同一プロセス内で呼び出されます。
|
||||
- 開発時は tools/front_exe/runner_front.sh をゲートONで差し替え可能(1行契約の互換を維持)。
|
||||
|
||||
Responsibilities
|
||||
- Parse CLI/ENV relevant to backend/mode/entry.
|
||||
- Produce a short verdict and exit code:
|
||||
- OK: adopt decision (prints normalized JSON or token) and exit 0
|
||||
- NOOP: no decision; Rust runner proceeds with legacy path, exit 0
|
||||
- FAIL: stable tag, exit non‑zero (no fallback by design)
|
||||
|
||||
Inputs/Outputs (contract)
|
||||
- Input: CLI args + ENV (documented below)
|
||||
- Output: one short line (OK/NOOP/FAIL + payload or tag) to stdout
|
||||
- Exit codes: 0=adopt/noop, 1=fail
|
||||
|
||||
ENV (planned; default OFF)
|
||||
- HAKO_RUNNER_USE_SCRIPT_EXE=1 (alias NYASH_*) — enable front EXE adoption
|
||||
- HAKO_QUIET=1 — silence noisy logs (front adheres to quiet)
|
||||
|
||||
Non‑Goals
|
||||
- No plugin/ABI routing here (handled downstream)
|
||||
- No semantics; runner_front only decides and normalizes
|
||||
|
||||
TTL / Removal Plan
|
||||
- Runner boundary diagnostics/tags are temporary; migrate to core/front over time.
|
||||
8
lang/src/tools/vm_front/LAYER_GUARD.hako
Normal file
8
lang/src/tools/vm_front/LAYER_GUARD.hako
Normal file
@ -0,0 +1,8 @@
|
||||
#![doc = "Phase 20.13 vm_front guard — define layer responsibilities."]
|
||||
|
||||
static box VM_FRONT_GUARD {
|
||||
name() { return "vm_front" }
|
||||
allowed_imports() { return ["json", "env"] }
|
||||
forbidden_imports() { return ["vm_core", "llvm", "plugins", "ffi"] }
|
||||
}
|
||||
|
||||
26
lang/src/tools/vm_front/README.md
Normal file
26
lang/src/tools/vm_front/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
# vm_front — VM Front EXE (Phase 20.13; optional)
|
||||
|
||||
Purpose
|
||||
- Provide light dispatch hints/normalization prior to VM/LLVM execution.
|
||||
- Keep semantics in VM/LLVM; vm_front only shapes inputs and rejects invalid cases early.
|
||||
|
||||
Responsibilities
|
||||
- Normalize callee/method hints; produce OK/NOOP/FAIL (short) with exit code.
|
||||
|
||||
Notes (AOT / Single‑EXE)
|
||||
- 将来的に単一exeに内蔵(AOT)され、同一プロセスで前段整流を行います。
|
||||
- 開発時は tools/front_exe/vm_front.sh をゲートONで差し替え可能です。
|
||||
|
||||
Inputs/Outputs
|
||||
- Input: small JSON describing callsite/callee
|
||||
- Output: one-line verdict (OK/NOOP/FAIL) + exit code
|
||||
|
||||
ENV (planned; default OFF)
|
||||
- HAKO_VM_USE_SCRIPT_EXE=1 (alias NYASH_*) — enable vm front EXE
|
||||
- HAKO_QUIET=1
|
||||
|
||||
Non‑Goals
|
||||
- No execution, no state, no ABI interaction.
|
||||
|
||||
TTL
|
||||
- Runner-side formatting will migrate here after stabilization.
|
||||
Reference in New Issue
Block a user