← board

RTTI: field get/set by name (extends the VMT-8 method-reflection blob)

Method reflection exists (VMT-8 blob: names + invoke-by-name, shipped in the fpcunit arc). Missing: FIELD reflection — per-class table of (name, type kind, byte offset, record id for aggregates), plus runtime helpers:

Notes:

Gate: make test + self-host byte-identical; regression exercising field get/set by name on a class with mixed field types incl. a record field and a variant.

2026-07-21 finding — the current field RTTI is INSUFFICIENT for this

Measured while scoping the uforth exec() bridge (pyeval). Two concrete gaps the implementation MUST close, both verified in rtti_emit.inc:

Consumer census (uforth PYTHON blocks): ~25 distinct vm members are touched — FIELDS memory, vars, here, rstack, stack, dict, base, _pic_buf, current_def_tokens, input_line, fstack, input_pos, current_token_index, current_def_name, xt_table and METHODS define_word, next_token_strict, next_token, run_forth_word, exec_token_runtime, strip_string_token, is_string_token, trace.

LANDED 2026-07-21 (commit e8ebbf0a) — field side complete

FOLLOW-ON (not this ticket) — method table is ALSO published-gated

Discovered while landing fields: the METHOD table (UMthPub=1 gate in rtti_emit.inc) is published-only too, so GetMethodAddr finds NOTHING on a NilPy class — method invoke-by-name does NOT yet cover uforth's define_word / run_forth_word / etc. The exec bridge needs the same un-gating for methods, plus arity/param-type in MethInfo (currently name+code only) so the generic native-call trampoline can marshal args. Filed as part of the pyeval host-bridge work in [[feature-lib-pyexec]] (build with the trampoline), not here — this ticket was scoped to FIELD get/set and that is done.

Log