ludic/selfhost
Orkuncakilkaya dc475b17c2 Phase 6d: merge struct into property; storage follows use
`struct` and `property` had identical syntax and differed only in semantics, so
they are now one keyword: `property`. How a property is stored follows from how
it is used —

  - listed in a `model` or attached by `spawn`  -> an ECS component, kept in the
    engine's per-entity @S_/@H_ arrays and bound in queries (as before);
  - constructed with `new`                       -> a heap record with reference
    semantics (what `struct` used to be).

A program that declares only `property` records and functions — no `model`, no
`handler` — is not an ECS program: it gets record layouts and `new`, but no
entity storage, allocator, snapshot, or runtime splice. This is exactly the
shape of the Ludic compiler itself, whose Node/Tok/Buf/Val are now `property`.

Mechanics:
  - record layout (%Cmp_) now always emitted in the header (emit_head), so `new`
    works with or without the ECS; the per-entity arrays stay in
    emit_ecs_storage. %Str_ is gone — one layout prefix.
  - has_ecs() is now `has_systems() or has_models()`, not "any component"; a
    property alone no longer drags in the ECS runtime. Added has_models().
  - emit_new / member access / layout_ty / layout_node collapse onto find_comp.
    Dropped struct keyword, parse_struct, find_struct, is_struct_ty, N_STRUCT
    emission (the const stays at kind 0, the default node kind).

Migration done as two reseeds (the old compiler treats any component as ECS, so
it cannot see `property` records in the compiler source until has_ecs is fixed):
  A) teach the compiler property-as-record + fix has_ecs, keeping `struct`;
  B) migrate the compiler's own records to `property` and remove `struct`.

selfhost/tests/structs.ludic migrated (still prints 7 9 109 2 42). Vocabulary
drops `struct` from DECL (ludic_syntax.h, grammar, LudicTokens.kt). LANGUAGE.md
"Records" section rewritten. Reseeded (21613 lines); C-free fixpoint holds;
goldens identical; 17/17; vocab + doc-fences clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 23:32:05 +03:00
..
golden Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
tests Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
ast.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
bootstrap-cfree.sh Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
bootstrap.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
buf.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
build.sh Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
compile.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
emit_addr.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_core.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
emit_decl.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_ecs.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
emit_expr.ludic Scriptable properties (ECS-safe subset): @Computed and @OnSpawn 2026-08-27 21:01:32 +03:00
emit_game.ludic Add enable/disable across ECS scopes + @OnEnable/@OnDisable hooks 2026-08-27 23:05:47 +03:00
emit_head.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
emit_intrin.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_intrin2.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_machine.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_math.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_new.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
emit_query.ludic Add enable/disable across ECS scopes + @OnEnable/@OnDisable hooks 2026-08-27 23:05:47 +03:00
emit_save.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
emit_spawn.ludic Add enable/disable across ECS scopes + @OnEnable/@OnDisable hooks 2026-08-27 23:05:47 +03:00
emit_stmt.ludic Add enable/disable across ECS scopes + @OnEnable/@OnDisable hooks 2026-08-27 23:05:47 +03:00
emit_ui.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
game-build.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
io.ludic Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00
lex.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
ludicc.seed.ll Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
main.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
parse.ludic Phase 6d: merge struct into property; storage follows use 2026-08-27 23:32:05 +03:00
parse_game.ludic Phase 6b: a handler's query is @Queries only; drop the signature clauses 2026-08-27 23:20:09 +03:00
reseed.sh Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
str.ludic Phase 2: enforce statement separators (Rule B) 2026-08-27 15:41:29 +03:00
test.sh Baseline: Ludic compiler + toolchain, Phase 1 syntax fixes complete 2026-08-27 15:15:35 +03:00