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:
nyash-codex
2025-11-02 19:27:29 +09:00
parent 4edd9517a4
commit 63f1242a57
3 changed files with 53 additions and 0 deletions

View 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 providerfirst 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 (FailFast, 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 nonzero (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 (providerside)
- `HAKO_LLVM_TIMEOUT_MS=60000` — process timeout (providerside)
Notes
- BoxFirst: keep provider behind a single Plugin v2 method `LLVMCodegenBox.emit_object/2`.
- Environments must not change defaults silently; FailFast with stable tags.