Phase 20.34: wire Host providers via externs (env.mirbuilder.emit, env.codegen.emit_object); implement MirBuilder provider (Program→MIR JSON) and ny-llvmc wrapper; update Hako boxes (MirBuilderBox, LLVMEmitProviderBox) to delegate; adjust canaries to PASS (MirBuilder PASS, LLVM SKIP on unresolved or missing ny-llvmc).

This commit is contained in:
nyash-codex
2025-11-02 20:06:00 +09:00
parent 63f1242a57
commit 8827b8d416
8 changed files with 219 additions and 20 deletions

View File

@ -21,7 +21,7 @@ static box MirBuilderBox {
}
// Main entry
emit_from_program_json_v0(program_json, opts) {
method emit_from_program_json_v0(program_json, opts) {
if program_json == null {
print("[mirbuilder/input/null] program_json is null")
return null
@ -35,12 +35,13 @@ static box MirBuilderBox {
// Delegate-first policy (Phase 20.34 Milestone A)
local d = env.get("HAKO_MIR_BUILDER_DELEGATE")
if d != null && ("" + d) == "1" {
print("[mirbuilder/delegate] use Runner --program-json-to-mir")
return null
// Call host provider via extern: env.mirbuilder.emit(program_json)
local args = new ArrayBox(); args.push(program_json)
local ret = hostbridge.extern_invoke("env.mirbuilder", "emit", args)
return ret
}
// Provider not wired yet
// Provider not wired → FailFast tag
print("[mirbuilder/delegate/missing] no provider; enable HAKO_MIR_BUILDER_DELEGATE=1")
return null
}
}