docs / surface
fx surface map (as implemented)
Package 0.9.74 — complete inventory of shipped functionality.
If it is not listed here, do not assume it exists. Includes typed Id,
lexical loans, no-grow v[i]=x, concurrency facades, SIMD / @override,
and a full std/ module list.
Prefer the language tour when learning.
Prefer this page when asking "does fx have X?"
Package markdown: docs/SURFACE.md.
A. Kernel
Keywords
enum struct extern fn import
let match module return effects
if while for break continue
else defer region arena scope
temp fx own mut true false
using · Ok / Err
Comments: //. Refinement where is verification-tier only.
Types
| Kind | Forms |
|---|---|
| Integers | i8 i16 i32 i64 · u8…u64 |
| Floats | f32 f64 |
| Scalars | bool string void core_Err |
| User types | struct · enum (unit + payload) |
| Collections | Vec<T> · [T; N] · &[T] · &mut [T] · StrBuilder · Map<string, i32> · Map<string, string> · Buf / Bytes |
| Sum / ownership | Result<T, E> · own · & · &mut · ®ion |
| SIMD | v4i32 · v4f32 · v16u8 (portable foothold) |
| Generics | type params on fn/struct · no traits |
Control · operators · Result
if/while/ C-stylefor/match/defer/break/continue- Index: arrays R/W;
&[T]read-only;&mut [T]write-through; Vec reads viav[i]/vec_get; no-grow slot writes viav[i]=x/vec_setundermut - Sub-slice:
a[lo..hi]→&[T](exclusivehi) - Record update:
p with { y: 32 } Ok/Err/?· noOption
B. Memory model
- Effects:
alloc·mut·io(signature-visible) - Regions:
arena·temp·scope·fx— see Regions - Growers are value-threaded: reassign
v = vec_push(v, x)(same for map / strbuf / buf) - Lexical loans: shared XOR mut on
&/&mut; region escape FX0015; borrow conflict FX0019; no lifetime parameters
C. Data (limits inline)
| Surface | Can | Cannot / limit |
|---|---|---|
Vec<T> | push/get/len; read v[i]; no-grow v[i]=x / vec_set | growable index assign that reallocates; many exotic element types |
&[T] | read; sub-slice | write through immutable view |
&mut [T] | index write-through (array-backed) | &mut Vec as slice; mut sub-slices |
Map<string, i32> | CRUD + map_nth_* + map_add_i32 | insertion-order iterate |
Pool / Id | std/pool typed handles; set → vec_set | bare i32 at get/set |
Map<string, string> | map_new_ss / shared map builtins | other KV shapes |
Buf / Bytes | grow + view helpers | general streaming I/O API |
D. std/
Core:
vec · string · map · set · buf ·
box · pair · math · fmt · io ·
queue · pool · fx_defaults
Caps / net:
cap · guest · io_cap · net
(TCP dial under NetCap; dial_tls always fails in this package)
Concurrency (link host/concur):
nursery · chan · select · mailbox · supervise · sync
· async (deprecated stub)
Also:
path · strutil · encoding · fs · fs_walk ·
log · json · json_validate · json_full ·
sqlite · http · time · env ·
testing · proptest
Details: Standard library · package docs/SURFACE.md §D.
D2–D4. Loans · SIMD · asm
- Lexical loans — shared XOR mut · region escape · Hylo call-end · no
loan { }sugar - SIMD —
v4i32/v4f32/v16u8+ helpers; scalar emit-C SoT; optional SSE/NEON @override/asm { }— portable fx body remains SoT; constrained clobber checks
E. Tooling
doctor · version · new · check ·
run / build · emit-c · surface ·
test / fuzz · cc ·
lsp · mcp · locate · bind ·
mod vendor|tidy|verify
Useful flags: --cli · --host · --guest ·
--driver auto|sh|foundry · --fallback-emit-c · --link.
Prebuilt: Windows + Linux x86_64. See CLI.
F. Interop
- Native-first Auto
fx run(the primary compiler path when supported; built-in fallback otherwise) · IR → native when QBE staged ·--emit-cfirst-class --cli/--hostfor Cmain·--usenative lib units · link-args helpers- TCP under NetCap; HTTPS via separate fxfetch tool (not in-package TLS)
- Non-C FFI not shipped · Wrap
G. Limits (0.9.74)
Also shipped: collection sugar v.push / m.insert; lexical loans; SIMD foothold;
@override / constrained asm; guest vec_filter / vec_map / vec_collect;
structured concurrency facades; module passport via fx surface.
Not claimed: traits, closures, iterators, Option; nested/exotic Vec shapes;
growable v[i]=x that reallocates; package registry; language-package TLS dial
(dial_tls always fails; use fxfetch); lexer keywords nursery/spawn/await;
macOS prebuilt; fx run program-argv passthrough; DAP mega-IDE; language-wide formal certification; calling this v1.0.
Quick "can I build X?"
| Goal | Path |
|---|---|
| Hello + visible heap | fx new hello → fx run |
| Grow collections | value-thread vec / map / buf / strbuf |
| Vec slot write | vec_set / no-grow v[i]=x · examples/pattern_pool |
| Shared XOR mut / loans | & / &mut · Regions |
| Tally / accumulate | map_add_i32 · examples/composition_tally |
| Graph / reachability | typed Id pool · examples/composition_reach |
| TCP dial | std/net.dial under NetCap |
| HTTPS GET | separate fxfetch tool |
| Structured concurrency | std/nursery + host/concur |
| Embed in C | --cli / --host |
| Inspect lowering | fx emit-c · fx surface |