docs+rename: erase the reify name everywhere — stream is METATYPE

The compiler concept is declare/define (comptime type construction); the
old "reify" framing is gone from the entire repo.

- Rename: PLAN-REIFY → PLAN-METATYPE, CHECKPOINT-REIFY → CHECKPOINT-METATYPE,
  PLAN-POST-REIFY → PLAN-POST-METATYPE (both rewritten around declare/define);
  examples 0614/0615/0617 → comptime-metatype-* (+ their expected/ triplets),
  headers rewritten.
- Scrub reify from design/execution-evolution-roadmap.md (§7 step 3 contracts,
  §8.1, §9 decisions, §10 gates) → declare/define / comptime type construction.
- core.sx prelude pointer + parser.test.zig surface lock updated to the
  declare/define builtins (define(handle, info) -> Type; EnumInfo.name).

No behavior change; renamed examples match their renamed snapshots. Full
suite green (673), all unit tests pass. Zero `reify` tokens remain in
src/docs/sx/examples.
This commit is contained in:
agra
2026-06-16 21:23:05 +03:00
parent 5f2419854e
commit 12e2ff7ef4
21 changed files with 280 additions and 503 deletions

View File

@@ -1,7 +1,8 @@
// REIFY Phase 0: mint a NEW nominal enum from a `TypeInfo` value at comptime,
// then construct one of its variants and match on it — exercising that a
// reify'd enum (with NO backing AST decl) flows through enum codegen unmodified
// (layout / construct / match), Contract 2.
// Comptime type construction: mint a NEW nominal enum from a `TypeInfo` value
// via the `define(declare(), info)` primitives, then construct one of its
// variants and match on it — exercising that a programmatically-built enum
// (with NO backing AST decl) flows through enum codegen unmodified (layout /
// construct / match), byte-identical to a hand-written enum.
//
// The enum has two variants: `value` carrying an i64 payload, and `closed` with
// no payload (`payload = void`).

View File

@@ -1,10 +1,10 @@
// REIFY Phase 1: a type-fn that RETURNS `reify(...)` must memoize by the
// instantiation's mangled name, so `Box(i64)` resolved at two INDEPENDENT sites
// (here: a return type and a parameter type) is ONE `TypeId`. A value built at
// one site is therefore assignable / matchable at the other — nominal identity
// (Contract 1). If the reify result were not registered under the mangled
// instantiation name, the two sites would mint distinct types and
// `consume(build())` would be a type error.
// Comptime type construction — identity: a type-fn that builds a type with
// `define(declare(), ...)` must memoize by the instantiation's mangled name, so
// `Box(i64)` resolved at two INDEPENDENT sites (here: a return type and a
// parameter type) is ONE `TypeId`. A value built at one site is therefore
// assignable / matchable at the other — nominal identity. If the minted result
// were not registered under the mangled instantiation name, the two sites would
// mint distinct types and `consume(build())` would be a type error.
#import "modules/std.sx";
#import "modules/std/meta.sx";

View File

@@ -1,5 +1,6 @@
// REIFY Phase 2: `field_type($T, i) -> Type` — the type-only field projection
// the value-level reflection (`field_value` / `type_of`) couldn't express.
// Comptime reflection: `field_type($T, i) -> Type` — the type-only field
// projection the value-level reflection (`field_value` / `type_of`) couldn't
// express.
// Reflect a struct's fields by name (`field_name`) AND by type (`field_type`),
// and a tagged-union's variant payloads. It folds at lower time, so it composes
// inside `type_eq` / `type_name` / any type-arg slot.

View File

@@ -1,9 +1,10 @@
// REIFY Phase 3: RecvResult($T) / TryResult($T) — the channel result types,
// built ENTIRELY in sx library code as type-fns over `reify` (no new compiler
// machinery beyond Phases 01). A blocking recv yields a value or a `closed`
// marker; a non-blocking try-recv adds `empty` — three states a bool can't
// express. This locks that they construct and match like any enum, and that
// `RecvResult(i64)` is one nominal type across sites (the type-fn identity path).
// Comptime type construction — channel result types: RecvResult($T) /
// TryResult($T), built ENTIRELY in sx library code as type-fns over the
// `define(declare(), ...)` primitives (no compiler machinery). A blocking recv
// yields a value or a `closed` marker; a non-blocking try-recv adds `empty` —
// three states a bool can't express. This locks that they construct and match
// like any enum, and that `RecvResult(i64)` is one nominal type across sites
// (the type-fn identity path).
#import "modules/std.sx";
#import "modules/std/meta.sx";