This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 11/4/2026.

Proto

import std/proto

Koru Standard Library: Proto — compound identity declarations

proto.kz · 13 tors

Koru Standard Library: Proto — compound identity declarations · 25 more lines
Koru Standard Library: Proto — compound identity declarations The compound front door for proto entries. `std/proto(Name) { fields }` invokes this module's `default` tor through the default-event rule (`std/M(args)` ≡ `std/M:default(args)`; see import_pipeline.zig rewriteDefaultEventCalls). The module name IS the verb — `default` is reachable only through the path, never bare. SURFACE: std/proto(Player) { health: Health, hp: f32 } declares a COMPILE-TIME registry entry — layout-silent, with no emission of its own. The first consumer derives what it needs (std/list:new synthesizes the element struct plus its `List_<Name>` container from these fields). The terminal half of the system — named primitives (`std/proto:f64(Health)`) — is the same act at field count zero and lands here as the system grows. RULED 2026-08-23 → 09-03 (frag-type-system-design, proto rung; co-derived on the 09-03 walk): a proto names an AFFINITY, never a coupling — the entry is the identity, "same thing" is by NAME ONLY, and the layout system may merge only what a shared name proves identical (never two anonymous fields that merely look alike). Two registrants of the same name are a loud collision; values over two different protos must not interchange (both refused at the KORU layer by the nominal-distinctness gate; see scanDeclaredTypes + the container registration it derives).

default

comptimetransform koru_std/proto.kz:32

i8

comptimetransform koru_std/proto.kz:229

i16

comptimetransform koru_std/proto.kz:239

i32

comptimetransform koru_std/proto.kz:249

i64

comptimetransform koru_std/proto.kz:259

u8

comptimetransform koru_std/proto.kz:269

u16

comptimetransform koru_std/proto.kz:279

u32

comptimetransform koru_std/proto.kz:289

u64

comptimetransform koru_std/proto.kz:299

f32

comptimetransform koru_std/proto.kz:309

f64

comptimetransform koru_std/proto.kz:319

bool

comptimetransform koru_std/proto.kz:329

string

comptimetransform koru_std/proto.kz:339

~part resolve koru_std/proto.resolve.kz

Koru Standard Library: proto compound-resolution machinery — joined via `~part resolve` in proto.kz; members land in koru_proto. TerminalRef resolves field types against scalars, terminals, compounds and `ref()` targets; GraphWalk (nested) owns the compound graph walk; the extension merge (entryName/parentSpec/findCompound/expandParents) lives here too — the `<:` field-set union, 698_OOP.

~part nodeaware koru_std/proto.nodeaware.kz

Koru Standard Library: the `nodeaware` part of proto.kz — joined via `~part nodeaware` in proto.kz; merged into the proto module namespace. Node-kind awareness for the shared registry. `std/tree:node(Name)` registers a KIND=node entry in the same one-name-per-home namespace the proto doors feed — but a node is an EDGE (owned, pointed to), never a payload. These scans let proto's field vocabulary say "names a tree node — edges point, they don't embed" instead of misreading the field as an unknown terminal, and give the tree lane's own readers the live door + erased-marker lookup. A live `std/tree:node(Name)` door — the mirror of liveDeclarationIs- Compound. Registration may be in flight when a reader runs, so the live door answers alongside the erased marker.

~part fields koru_std/proto.fields.kz

Koru Standard Library: the `fields` part of proto.kz. Joined via `~part fields` in proto.kz; merged into the koru_proto module. The proto entry grammar, applied once per block wherever author field text is re-parsed: a field line is ONE `name: type` entry, and one block binds each name once. The `default` door (proto.kz) and the `<:` parent re-parse (proto.resolve.kz) consume the same verdict — each caller owns only the refusal's wrapper, a SiteResult at the door and a message string inside the walk. Hand-rolled per the block-grammar ruling, but the rule is one rule: fusedFieldLine names the second field's fragment and a seen-set counts each name once.

~part ownedleaf koru_std/proto.ownedleaf.kz

Koru Standard Library: the `ownedleaf` part of proto — the owned-leaf field gate. Joined via `~part ownedleaf` in proto.kz; merged into the proto module. An owned leaf — `*mod:Type<state!>` — names an obligation-bearing pointer whose custody transits the whole value. The shape mirrors the store's owned-column contract (store.new.kz): pointer + module-qualified type + pinned `<state!>` — qualified so every consumer can locate the type's canonical discharger, `!`-suffixed because a bare `<state>` borrow is not owned. Like `ref(X)` the leaf is a REFERENCE — it joins no expansion and no cycle walk — but unlike ref it carries a debt the receiver must settle per path. One owned leaf of a proto — `fd: *mod:Type<state!>`.

~part markers koru_std/proto.markers.kz

Koru Standard Library: the `markers` part of proto — erased-marker scanning. Joined via `~part markers` in proto.kz; merged into the proto module. Proto decls self-erase to comment markers (`// proto Name: ...`, `// proto-terminal Name: scalar`) so post-transform passes and consumers can still resolve what a name declared. These predicates read those markers back.

~part terminal koru_std/proto.terminal.kz

Koru Standard Library: the `terminal` part of proto — scalar terminal minting. Joined via `~part terminal` in proto.kz; merged into the proto module. Declare a nominal scalar type through the proto door. The verb IS the host scalar — `std/proto:i64(Port)` mints `const Port = i64` — one tor per scalar in the field vocabulary (af.scalars). The marker ahead of the alias records the identity so compounds and consumers resolve `Port` without repeating the declaration. Keyword absent: terminal identity is module-spaced (`std/proto:i64`), not a bare global.