Handle is the gate on classes, and the allocator just made it buildable

This commit is contained in:
Joseph Ferano 2026-09-12 14:08:20 +07:00
parent 03692c35b5
commit a3fccf440c
2 changed files with 19 additions and 25 deletions

View File

@ -224,30 +224,7 @@ once, commit the result, regenerate when the library moves.
**Kebab-casing is separable and small**, with one constraint: it must be reversible, because the generated C wrapper
needs the library's own spelling.
## 7. Where `defclass` stands
Specified in `plan.org` and **deliberately not started** — its own last line says nothing happens until ordinary
`struct`, `Handle` and reload semantics work. Those have largely landed since that was written, so the gate may be closer
than the document assumes.
What it is meant to add: identity, runtime shape metadata, an implementation-defined representation, generic-function
dispatch, and live schema change with an explicit migration at a frame boundary — which is the answer to the one thing
redefinition still cannot do, changing a struct's layout while instances exist.
Three findings from an earlier review, recorded in `NEXT.md` and not yet in `plan.org`:
- **A generic function is a cell.** Adding a method from a later module is the same problem indirection cells already
solve, so the expensive half is built and tested.
- **The pool is not one storage option among three.** `migrate-instances` has to enumerate live instances, which a pool
behind a generational `Handle` gives by construction and the other two options do not.
- **Every layout version must stay resolvable** for as long as any instance holds it — the same rule as "nothing is ever
`dlclose`d".
Also open and related: whether a *condition* can be a class, which decides whether handler matching has one path or two.
`NEXT.md` records the argument; decision 4 there took the cheaper parent-link route for now and explicitly left real
inheritance possible later.
## 8. Watching variables
## 7. Watching variables
Raised while designing item 1, and deliberately separated from it.
@ -270,7 +247,7 @@ Questions it opens:
- **Whether it belongs in the break buffer at all**, or in its own window that is useful while the program is *running*,
which is arguably where a game developer wants it.
## 9. Indentation is wrong inside a binding vector
## 8. Indentation is wrong inside a binding vector
Reported against the `let` in `sand.flan`'s `settle`: the second and later bindings indent one column too far.

17
NEXT.md
View File

@ -345,6 +345,23 @@ Three things to settle while building it: whether it takes focus or only display
the window, being a deliberate stop rather than a failure; and what it does when the program stops while point is
mid-edit in another buffer.
**`Handle` and the pool are the real gate on classes, and they are buildable now.** plan.org's rule is that nothing
starts on managed classes "until ordinary `struct`, `Handle`, and reload semantics are working". Checked against the
tree: structs work fully; reload works with one known hole (a changed signature is refused rather than versioned);
**`Handle` does not exist at all** — `check.ml:218` still refuses `(Handle T)` by name.
It is not an incidental precondition. `migrate-instances` has to *enumerate* live instances, and a pool behind a
generational `(Handle T)` gives that by construction while a world arena and an owned region do not. plan.org presents
the three storage strategies as a free choice and they are not: handles are the one that makes migration possible.
**The allocator and arena landing today are what unblock it** — a pool is built on them, so `Handle` is buildable now
where it was not this morning. Build `Handle` and the pool next and treat *that* as the gate. It earns its place
independently of classes: stable references to things that move or die is something any game wants.
Already banked, and it means classes are less work than plan.org implies: **a generic function is an indirection cell**
whose body is a dispatch table, which a reload extends. That is the expensive half of method dispatch, and it is built
and tested.
## Blocked and unfinished
Everything below was found, decided or half-built and then stopped. Each says what blocks it. Nothing here is a