Context
The 2026-05-04-night audit shows 6 home-os kernel files failing because the parser doesn't recognize three builtin functions:
| Builtin | Files | Purpose |
|---|---|---|
@addrOf | 3 | Take address of an lvalue (alternative to &x) |
@atomicCmpXchg | 2 | Atomic compare-exchange |
@intFromEnum | 1 | Convert enum variant to its underlying integer |
Approach
These are small parser-table additions plus typechecker support. Find where existing reflection builtins (@as, @ptrCast, @truncate, @bitCast, @intCast, @ptrFromInt, etc.) are registered in the parser/typechecker, and add the three new ones with appropriate signatures:
@addrOf(expr)→*TwhereTis the type ofexpr. Equivalent to&expr.@atomicCmpXchg(ptr: *T, expected: T, desired: T) -> ?T— returns previous value if exchange failed, null if succeeded.@intFromEnum(variant) -> integer— extracts the integer tag of an enum variant.
Why this matters
6 home-os kernel modules unblocked. Small grammar/checker additions, low LoC each.
Reference
- Audit:
~/Desktop/home-os-kernel-audit-2026-05-04-night.tsv