Files
hakorune/apps/selfhost/vm/mir_min_entry.nyash
nyash-codex 510f4cf523 builder/vm: stabilize json_lint_vm under unified calls
- Fix condition_fn resolution: Value call path + dev safety + stub injection
- VM bridge: handle Method::birth via BoxCall; ArrayBox push/get/length/set direct bridge
- Receiver safety: pin receiver in method_call_handlers to avoid undefined use across blocks
- Local vars: materialize on declaration (use init ValueId; void for uninit)
- Prefer legacy BoxCall for Array/Map/String/user boxes in emit_box_or_plugin_call (stability-first)
- Test runner: update LLVM hint to llvmlite harness (remove LLVM_SYS_180_PREFIX guidance)
- Docs/roadmap: update CURRENT_TASK with unified default-ON + guards

Note: NYASH_DEV_BIRTH_INJECT_BUILTINS=1 can re-enable builtin birth() injection during migration.
2025-09-28 12:19:49 +09:00

16 lines
680 B
Plaintext

// mir_min_entry.nyash — MirVmMin の薄いエントリ
// 引数があれば JSON を第1引数から受け取る。無ければデフォルトの const→ret (42)。
using selfhost.vm.mir_min as MirVmMin
static box Main {
main(args) {
// 既定の最小 MIR(JSON v0)
local json = "{\"functions\":[{\"name\":\"main\",\"params\":[],\"blocks\":[{\"id\":0,\"instructions\":[{\"op\":\"const\",\"dst\":1,\"value\":{\"type\":\"i64\",\"value\":42}},{\"op\":\"ret\",\"value\":1}]}]}]}"
if args != null { if args.size() > 0 { local s = args.get(0) if s != null { json = s } } }
local v = MirVmMin._run_min(json)
print(MirVmMin._int_to_str(v))
return 0
}
}