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/protoKoru Standard Library: Proto — compound identity declarations
proto.kz · 13 tors
Koru Standard Library: Proto — compound identity declarations · 25 more lines
~[comptime|transform] pub tor default {
expr: Expression,
source: ?Source,
item: std/compiler:*const Item,
program: std/compiler:*const Program,
allocator: std.mem.Allocator,
reporter: std/compiler:*ErrorReporter
} -> SiteResult// `mintTerminal` — the scalar-terminal minter — lives in
// proto.terminal.kz (the `terminal` part).
~[comptime|transform] pub tor i8 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor i16 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor i32 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor i64 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor u8 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor u16 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor u32 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor u64 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor f32 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor f64 {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor bool {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~[comptime|transform] pub tor string {
expr: Expression,
item: std/compiler:*const Item,
allocator: std.mem.Allocator
} -> SiteResult~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.