A thin layer over the C ABI. One Swift file per header - Types, Model, Encode, Train - and a C verb uform_<noun>_<verb> is a camel-cased method here, such as imageEncodePixels.
The receiver chooses, the verb stays. The model runs a verb on the calling thread, on(executor) blocks on an executor, and deferred(executor) submits it, all with the same arguments.
Deferred calls use the language’s own idioms.status polls through uform_outcome_status, wait() blocks through uform_outcome_wait, and try await call.value runs that wait on a Dispatch thread, so an async caller suspends.
No life of its own. The binding starts no threads, keeps no queues and caches nothing; releasing a Deferred rides its deinit, which waits for the call first.
Arenas are lent and reused, never shared. Every output verb takes an arena and answers views borrowing it; a view remembers which call wrote it and traps once a later one did.
Statuses and modes are enums.Status, Scalar, Mood, CPUClass, GPUClass, Modality, Objective, Negatives and MultimemTier carry their C enumerators and spell themselves through the C name functions, never strings.
Nothing costs anything until it is used. Blocking calls take no deferred-table entry, a surface outputs leaves out is never computed, and an arena allocates only when a call writes into it.
What this binding does not expose. The constructors address no model or trainer yet, so no receiver offers them; each blocks, the model loads on an optional executor and the trainer and mesh on a required one.
A trainer is bound to the executor it was made on, so its verbs block there and take no receiver.