Phase 20.34 prep: add using aliases in nyash.toml for hako.mir.builder & hako.llvm.emit; add README contracts for MirBuilderBox/LLVMEmitBox; verify canaries green
This commit is contained in:
27
lang/src/llvm_ir/emit/README.md
Normal file
27
lang/src/llvm_ir/emit/README.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# LLVMEmitBox — MIR(JSON v0) → Object (.o)
|
||||||
|
|
||||||
|
Responsibility
|
||||||
|
- Generate an object file from MIR(JSON v0) via a provider.
|
||||||
|
- Phase 20.34 starts with a provider‑first stub; connects to a Plugin v2 wrapper for ny-llvmc (or llvmlite) next.
|
||||||
|
|
||||||
|
Interface (stable)
|
||||||
|
- `emit_object(mir_json: String, opts: Map|Null) -> String|Null`
|
||||||
|
- Returns output path string on success; returns null with a tagged diagnostic on failure.
|
||||||
|
|
||||||
|
Tags (Fail‑Fast, stable)
|
||||||
|
- `[llvmemit/input/null]` — input is null
|
||||||
|
- `[llvmemit/input/invalid]` — missing `functions`/`blocks`
|
||||||
|
- `[llvmemit/provider/missing]` — no provider hint
|
||||||
|
- `[llvmemit/provider/unsupported] <name>` — unsupported provider name
|
||||||
|
- `[llvmemit/ny-llvmc/not-found]` — ny-llvmc not found (planned)
|
||||||
|
- `[llvmemit/ny-llvmc/failed status=N]` — ny-llvmc returned non‑zero (planned)
|
||||||
|
- `[llvmemit/skip] provider stub; implement Plugin v2 call` — current stub behavior
|
||||||
|
|
||||||
|
Toggles (default OFF)
|
||||||
|
- `HAKO_LLVM_EMIT_PROVIDER=ny-llvmc|llvmlite` — select provider
|
||||||
|
- `HAKO_LLVM_OPT_LEVEL=0..3` — optimization level (provider‑side)
|
||||||
|
- `HAKO_LLVM_TIMEOUT_MS=60000` — process timeout (provider‑side)
|
||||||
|
|
||||||
|
Notes
|
||||||
|
- Box‑First: keep provider behind a single Plugin v2 method `LLVMCodegenBox.emit_object/2`.
|
||||||
|
- Environments must not change defaults silently; Fail‑Fast with stable tags.
|
||||||
22
lang/src/mir/builder/README.md
Normal file
22
lang/src/mir/builder/README.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# MirBuilderBox — Program(JSON v0) → MIR(JSON v0)
|
||||||
|
|
||||||
|
Responsibility
|
||||||
|
- Convert Stage‑B Program(JSON v0) into MIR(JSON v0) for VM/LLVM lines.
|
||||||
|
- Phase 20.34 starts with a delegate implementation to Runner and progressively internalizes ops.
|
||||||
|
|
||||||
|
Interface (stable)
|
||||||
|
- `emit_from_program_json_v0(program_json: String, opts: Map|Null) -> String|Null`
|
||||||
|
- Returns canonical MIR(JSON v0) on success; returns null and prints a tagged diagnostic on failure.
|
||||||
|
|
||||||
|
Tags (Fail‑Fast, stable)
|
||||||
|
- `[mirbuilder/input/null]` — input is null
|
||||||
|
- `[mirbuilder/input/invalid]` — header missing (version/kind)
|
||||||
|
- `[mirbuilder/delegate]` — delegate path selected (Runner `--program-json-to-mir`)
|
||||||
|
- `[mirbuilder/delegate/missing]` — delegate/provider not wired yet
|
||||||
|
|
||||||
|
Toggles (default OFF)
|
||||||
|
- `HAKO_MIR_BUILDER_DELEGATE=1`: Use Runner `--program-json-to-mir` as a temporary provider
|
||||||
|
|
||||||
|
Notes
|
||||||
|
- Box‑First policy: boundary/contract first, then implementation. Keep tags stable; no silent fallback.
|
||||||
|
- Large payloads: implementation may stream/json-scan later; initial version is string‑based.
|
||||||
@ -152,6 +152,10 @@ path = "lang/src/shared/common/string_helpers.hako"
|
|||||||
"hakorune.vm.mir_min" = "lang/src/vm/boxes/mir_vm_min.hako"
|
"hakorune.vm.mir_min" = "lang/src/vm/boxes/mir_vm_min.hako"
|
||||||
"hakorune.vm.core" = "lang/src/vm/boxes/mini_vm_core.hako"
|
"hakorune.vm.core" = "lang/src/vm/boxes/mini_vm_core.hako"
|
||||||
|
|
||||||
|
# Phase 20.34 — Box‑First selfhost build line (aliases for Hako boxes)
|
||||||
|
"hako.mir.builder" = "lang/src/mir/builder/MirBuilderBox.hako"
|
||||||
|
"hako.llvm.emit" = "lang/src/llvm_ir/emit/LLVMEmitBox.hako"
|
||||||
|
|
||||||
# Temporary alias keys removed (Phase‑20.33 TTL reached). Use `selfhost.shared.*` above.
|
# Temporary alias keys removed (Phase‑20.33 TTL reached). Use `selfhost.shared.*` above.
|
||||||
|
|
||||||
# v2 Plugin libraries (loader reads these for TypeBox ABI)
|
# v2 Plugin libraries (loader reads these for TypeBox ABI)
|
||||||
|
|||||||
Reference in New Issue
Block a user