iteration-1: the compiler stops adjudicating #164

Merged
will.anderson merged 49 commits from iteration-1 into dev 2026-08-17 15:55:22 +00:00
2 changed files with 22 additions and 1 deletions
Showing only changes of commit 886626a64e - Show all commits
+1 -1
View File
@@ -3208,7 +3208,7 @@ fn cg_entry_seam(stmt: Map<String, Any>, fn_name: String) -> Void {
// RUNTIME SEAM: codegen cannot know which constructs will be bound to this
// fn after the binary exists, so the indirection is unconditional. What
// applies is resolved at execution against a table written later.
emit_line(" el_seam_run(EL_STR(" + c_str_lit(fn_name) + "), 0, 0);")
emit_line(" { el_val_t __s = el_seam_run(EL_STR(" + c_str_lit(fn_name) + "), 0, 0); if (__s) return __s; }")
let gdl = stmt["decorators"]
let n_gdl: Int = native_list_len(gdl)
let gi = 0
+21
View File
@@ -903,3 +903,24 @@ test "seeded-vbd-prohibition-still-enforced" {
let out: String = compile_capture(src)
assert str_contains(out, "may only be called from an @manager fn"), "the compiled-in core prohibition survives being declared rather than branched"
}
// Runtime seam
//
// CONTROL for the finding that a crossing can be resolved at execution rather
// than at emission. Codegen emits one unconditional indirection per fn; which
// constructs apply is read from a table written after the binary exists.
test "seam-indirection-emitted-on-every-fn" {
let src: String = "fn a() -> Int { return 1 }\nfn b() -> Int { return 2 }"
let out: String = compile_capture(src)
assert str_contains(out, "el_seam_run(EL_STR(\"a\"), 0, 0);"), "fn a carries the indirection"
assert str_contains(out, "el_seam_run(EL_STR(\"b\"), 0, 0);"), "fn b carries the indirection"
}
test "seam-emitted-without-any-decorator" {
// The point of the seam: source need not mention a construct at all.
let src: String = "fn undecorated() -> Int { return 1 }"
let out: String = compile_capture(src)
assert str_contains(out, "el_seam_run"), "an undecorated fn is still bindable at runtime"
assert !str_contains(out, "engram_boundary_beat"), "and nothing is inlined for it"
}