docs / composition

fx · 0.9.0

Composition under regions

How to build real programs in fx without treating it as a GC language — and without an unsafe dialect.

Package markdown: docs/COMPOSITION.md. Dual-emit tracking → Tracking.

Lane A — the fx method (default)

There is no unsafe path. Convenience helpers and Growing/Frozen phase types were skipped — prefer ids, pools, and SoA.

Patterns

fx run examples/pattern_ids/main.fx
fx run examples/pattern_mut_table/main.fx
fx run examples/pattern_grow_freeze/main.fx
fx run examples/pattern_pool/main.fx
fx run examples/pattern_ring/main.fx

Composition example programs

fx run examples/composition_tally/main.fx   # multi-pass Map add_i32 → 42
fx run examples/composition_reach/main.fx   # typed Id pool + BFS → 42
fx run examples/cap_host_smoke/main.fx      # host mints read; guest has no io → 42

Prefer parallel Vecs + typed ids (SoA). Host-minted I/O keeps authority at the C boundary.

Related