green(reify): declare/define floor — reify is sx; E :: reify(...) comptime-evaluated

First slice of the re-architecture. The compiler gains two comptime
type-construction builtins — declare() (mint an empty/undefined nominal
slot) and define(handle, info) (decode a TypeInfo VALUE + complete the
slot) — executed by the interpreter against a new `mint` TypeTable handle
(setMintTable). reify becomes PLAIN sx in meta.sx:
  reify :: (info) -> Type { h := declare(); define(h, info); return h; }

`E :: f(...)` where f is a non-generic Type-returning fn (reify, and later
make_enum) is now comptime-evaluated via evalComptimeTypeNamed: wrap the
call in a throwaway comptime fn, run it through the interp with the mint
table enabled so declare/define mint the type, read back the type_tag, and
rename the anonymous slot to the binding name. The compiler has ZERO reify
knowledge at the decl site — the old `E :: reify` hook is deleted.

examples/0614 (inline reify) now runs on this floor. Full suite green (673).

INTERMEDIATE: reifyType + findReturnReifyCall still serve the type-fn path
(0615/0617) and will be deleted in the next slice (type-fn body
comptime-eval), after which the compiler has no reify code at all.
This commit is contained in:
agra
2026-06-16 20:39:02 +03:00
parent ae27cffe9d
commit 442a70b8c9
7 changed files with 241 additions and 14 deletions

View File

@@ -1566,6 +1566,8 @@ pub const Lowering = struct {
pub const evalComptimeMatch = lower_comptime.evalComptimeMatch;
pub const evalComptimeInt = lower_comptime.evalComptimeInt;
pub const evalComptimeString = lower_comptime.evalComptimeString;
pub const evalComptimeTypeNamed = lower_comptime.evalComptimeTypeNamed;
pub const renameReifiedType = lower_comptime.renameReifiedType;
pub const lowerComptimeGlobal = lower_comptime.lowerComptimeGlobal;
pub const lowerComptimeSideEffect = lower_comptime.lowerComptimeSideEffect;
pub const lowerComptimeCall = lower_comptime.lowerComptimeCall;