Repository navigation
Conversation
|
Design decision, 2026-10-07, decided by the project owner: accepted.
Condition before merge: register them as {
"id": "type-reflection",
"kind": "language-feature",
"classification": "experimental",
"source": "docs/language/type-identity.md",
"owner_issue": 775,
"note": "@schema_revision(N), type_member_count<T>(), type_member_table<T>() and the per-target type_sizeof_*, type_alignof_* and type_layout_* names for native64 and wasm32 are public API at Experimental stability (decided 2026-10-07). They may change before a 1.x review."
}Also fold in from closed #1387 the docs/coverage.json entry for type-identity.md and the tests/scripts/doc_coverage.flow change, leaving out its scratch output files. Recorded in docs/project/Questions.md by #1422. |
The project owner decided six open design questions on 2026-10-07: orchestration starts as a std.orchestrate library (#723, #1393 closed), request and persistent lifetime domains (#1369), @Lifetime on struct fields with LD5 (#1358), last-use moves without a move keyword or COW (#1354), the type reflection API at Experimental stability (#1365), and the Linux release qualification policy (#1399). Questions.md archives each one. The Flow 3.0 tracker records the library-first rule for orchestration. Follow-up on persistent and TransportSafe is #1421.
The project owner decided six open design questions on 2026-10-07: orchestration starts as a std.orchestrate library (#723, #1393 closed), request and persistent lifetime domains (#1369), @Lifetime on struct fields with LD5 (#1358), last-use moves without a move keyword or COW (#1354), the type reflection API at Experimental stability (#1365), and the Linux release qualification policy (#1399). Questions.md archives each one. The Flow 3.0 tracker records the library-first rule for orchestration. Follow-up on persistent and TransportSafe is #1421.
The project owner decided six open design questions on 2026-10-07: orchestration starts as a std.orchestrate library (#723, #1393 closed), request and persistent lifetime domains (#1369), @Lifetime on struct fields with LD5 (#1358), last-use moves without a move keyword or COW (#1354), the type reflection API at Experimental stability (#1365), and the Linux release qualification policy (#1399). Questions.md archives each one. The Flow 3.0 tracker records the library-first rule for orchestration. Follow-up on persistent and TransportSafe is #1421.
#775) The remaining slice of #775. @schema_revision(N) on structs, enums and aliases feeds type_schema_id without changing type_family_id. type_member_count<T>() and type_member_table<T>() expose the members. type_sizeof_*, type_alignof_* and type_layout_* give native64 and wasm32 layout descriptors separately from the semantic IDs. The names are public at Experimental stability per the 2026-10-07 decision; stability/surfaces.json gains a type-reflection surface. Rebased from PR #1365 onto current main (CHANGELOG conflict kept both sides).
Fixed point at gen2; bootstrap_from_c.sh --verify passes.
bae20d2 to
721a4bb
Compare
|
Prepared for merge on main
Gates on the rebased tree: flowc selftest PASS;
|
#775) The remaining slice of #775. @schema_revision(N) on structs, enums and aliases feeds type_schema_id without changing type_family_id. type_member_count<T>() and type_member_table<T>() expose the members. type_sizeof_*, type_alignof_* and type_layout_* give native64 and wasm32 layout descriptors separately from the semantic IDs. The names are public at Experimental stability per the 2026-10-07 decision; stability/surfaces.json gains a type-reflection surface. Rebased from PR #1365 onto current main (CHANGELOG conflict kept both sides).
#775) The remaining slice of #775. @schema_revision(N) on structs, enums and aliases feeds type_schema_id without changing type_family_id. type_member_count<T>() and type_member_table<T>() expose the members. type_sizeof_*, type_alignof_* and type_layout_* give native64 and wasm32 layout descriptors separately from the semantic IDs. The names are public at Experimental stability per the 2026-10-07 decision; stability/surfaces.json gains a type-reflection surface. Rebased from PR #1365 onto current main (CHANGELOG conflict kept both sides).
Closes #775
Intent
Linked issue or roadmap item: #775 (remaining slice after merged #1340).
What changed, and why is this the smallest useful change?
#1340 shipped family/schema IDs,
alignof, andTransportSafe. This slice adds the three remaining capabilities named on that PR and on the issue:@schema_revision(N)onstruct/enum/typealiases, included intype_schema_id(nottype_family_id)type_member_count<T>()/type_member_table<T>()— target-independent public-field descriptiontype_sizeof_*/type_alignof_*/type_layout_*for native64 (ptr=8) and wasm32 (ptr=4)No new reflection syntax. IDs and certificates stay compile-time integer constants.
Overlap check
Overlap / dependency notes: #1340 is merged. No open PR covered the remaining #775 surface.
Evidence
Baseline before this change: family/schema IDs and TransportSafe exist; there is no member table, no schema revision attribute, and no native64-vs-wasm32 layout certificate.
Targeted proof that exercises the changed behaviour:
type_id_ok=1(revision, member count/table, Point layout match, HasPtr 16 vs 8)tests/lang/test_type_schema_layout.flowtests/scripts/type_identity.flow(revision vs family, member table, layout certs)Why that proof would detect the old failure or regression: the old compiler rejects the new builtins and
@schema_revisionon types; a family that absorbed revision would fail the same-name script check; equal layout certs forHasPtrwould fail the pointer-divergence check.Repository gate(s) run:
env -u FLOWC_IN -u FLOWC_OUT "$(./flow tool compiler/scripts/flowc_host.flow)"→flowc: PASSincludingtype_id_ok=1./compiler/scripts/bootstrap_from_c.sh --regen→ fixed point at gen2./compiler/scripts/bootstrap_from_c.sh --verify→ALL PASS bootstrap_from_c./flow test-lang→ all 267 language tests passed (includestest_type_identity.flowandtest_type_schema_layout.flow)./flow tool tests/scripts/type_identity.flow→ 6 passed (declaration order, field order, field type, schema revision vs family, member table, native64/wasm32 layout certs)./flow tool compiler/scripts/fmt_check.flow --check→fmt gate OKGenerated/bootstrap state:
compiler/bootstrap/flowc_stage_a.cregenerated after the source edits in a separate commit.Risk
Compatibility, performance, security, lifetime, backend, or release implications:
Additive builtins and one type-level attribute. Unversioned
type_schema_idvalues are unchanged (;rev;Nis omitted when N is 0).docs/project/Questions.mdupdated if this needs a language-design decision.The three-level split and schema-revision-in-digest were already decided on #775.
Compatibility
docs/project/CHANGELOG.md.CHANGELOG notes the additive surface under Unreleased.
Agent handoff
Cloud agent implementing the remaining #775 slice. Do not merge from this session.