Type intelligence and API maturity. The headline is a cross-linked type
graph that surfaces RTTI data (members, offsets, sizes, layout,
inheritance, enum values, destructors) which 0.2.0 parsed internally but
never exposed on the facade.
Added
typesmodule +NimBinary::types()— the full Nim type graph
recovered from V1 (TNimType) and V2 (TNimTypeV2) RTTI. Each
NimTypemerges the RTTI symbol with parsed struct fields and resolves
raw pointers into cross-references: member field types and parent
(inheritance) types asTypeRef, and destructor / trace / finalizer /
marker / deepcopy procs asCodeRef(demangled function + module). New
public types:NimType,TypeField,EnumValue,TypeRef,CodeRef,
TypeFlags,TypeShape. Accessorstype_at(va),object_types(),
enum_types(), andtype_rva().- V2 inheritance chain decoded from the
displayclass-token array
(depth + 1tokens, RESEARCH.md §3.2), with V2 parents linked through it. - V1 enum values (
name,ordinal) recovered from theTNimNode
slots, distinct from struct fields. - V2 → V1 field bridge: a non-nil
typeInfoV1backpointer is followed
to import member names for ARC/ORC objects lackingnimTypeNames. - Non-file-backed RTTI globals (Mach-O
__DATA,__common, §3.6) degrade to
name-only entries (is_readable() == false) instead of being dropped.
- V2 inheritance chain decoded from the
entrypointsmodule +NimBinary::code_entrypoints()— one
deduplicated, VA-sorted stream of every labelled code address (entry shims,
module inits, demangled procs, raise-enclosing functions, RTTI destructor /
trace procs), tagged byEntrypointKind.NimBinary::nim_version()→NimVersionHint(Nim1xRefc/Nim2xArc
/Nim2xOrc/Unknown), splitting ARC vs ORC by the presence of the ORC
cycle collector (collectCycles). Heuristic; see rustdoc for limits
(stripped ORC builds report as ARC).- Ergonomics:
Format::is_elf()/is_pe()/is_macho();Arch::bits()and
Arch::is_64bit();NimBinary::bitness()/is_64bit();
DetectionMatches::bits()/from_bits()/from_bits_truncate();as_str()on
every public discriminator enum (Format,Arch,GcMode,ShimKind,
PathOs,NimKind,RttiVersion, plus the newTypeShape,
EntrypointKind,NimVersionHint). - Compile-time
Send + Syncguarantee onNimBinary, plus a documented
robustness contract (never panics, empty on missing, skip-per-record)
and address-space contract in the crate docs.
Changed
examples/dump.rsnow prints the full type graph (members, offsets, enum
values, inheritance, resolved destructors), the code-entrypoint kind
histogram, and the Nim version hint.