ludic/examples
Orkuncakilkaya 6e11212cf2 Lifecycle hooks: @OnStart/@OnQuit, @OnDespawn, @OnAttach (like @OnSpawn)
Adds the rest of the game/entity/property lifecycle as @-hooks, each firing at
one timeline moment and reducing to ordinary code:

- @OnStart / @OnQuit (program): @OnStart aliases the Start phase; @OnQuit runs in
  the frame loop's done: block, after the loop stops and before teardown.
- @OnDespawn(Model) (entity): a destructor. Despawn doesn't statically know the
  entity's model, so hooks compile to @on_despawn_<Model>(entity) functions and
  emit_despawn dispatches on @L_kind. Symmetric with @OnSpawn.
- @OnAttach(Property): fires in emit_init_component once a property is attached
  and seeded, with the property bound by name.

Registries + parsing mirror @OnSpawn. examples/lifecycle.ludic narrates the whole
timeline (output 1 700 50 950 2). Behaviour-preserving (goldens byte-identical,
despawn users unaffected when no hooks registered); test.sh 16/16, fixpoint holds.

Deferred: @OnDetach (per-property runtime dispatch) and scene @OnEnter/@OnExit
(need scene support in the compiler).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-27 21:15:50 +03:00
..
chronorift Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
lib Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
annotations.ludic Scriptable properties (ECS-safe subset): @Computed and @OnSpawn 2026-08-27 21:01:32 +03:00
chronorift.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
hello.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
lifecycle.ludic Lifecycle hooks: @OnStart/@OnQuit, @OnDespawn, @OnAttach (like @OnSpawn) 2026-08-27 21:15:50 +03:00
menu.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
qdecl.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
scenes.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00
snake.ludic Phase 6a: rename core vocabulary (game/main/component/archetype/system) 2026-08-27 18:22:13 +03:00