Standard library
The built-in intrinsics: compiler-lowered calls, grouped by namespace.
The bet standard library is a pile of compiler intrinsics, not source you can go read. pull "spill" (and friends) is a no-op that just makes the namespace name available; the compiler lowers
each namespace.method call straight to a runtime primitive. So these are built-in calls, neither
keywords nor library files. Name a local variable the same thing and it shadows the namespace, which
is exactly how a program gets to define its own net, time, or str module without a fight.
Only intrinsics that actually exist and run are listed here, no vaporware. The I badge means the
call works in the interpreter (bet run); C means it works in the compiled backend. Most do both.
Graphics, audio, and input live in their own namespace; see Graphics (gg).
Reserved but not implemented yet (so
pulltreats them as intrinsics, not files):fmt,time, andnethave no methods wired up. On strings,+is the concatenation operator.
bet run)Cruns in the compiled backendPrint x in its display form plus a newline. Type-directed: ints, floats, bool → nocap/cap, ghosted, and string literals each print correctly.
Formatted print, no trailing newline. fmt is a literal string; {} are filled left-to-right; {{ }} are literal braces.
Byte length.
Byte at index i (0–255); traps out of range.
Substring s[start..end] (shares storage).
Byte-slice view.
Checked UTF-8; empty string on malformed input.
Unchecked, zero-copy []u8 → str.
Uppercase.
Byte equality.
Concatenation (operator, not a method).
Seeded PRNG handle (xoshiro256** / SplitMix64). Deterministic and bit-identical across interp and compiled.
Explicit wrapping add, any width/signedness (the escape hatch from signed-overflow-traps).
Raw next 64-bit draw.
Float in [0.0, 1.0) (the RND analog).
Unbiased int in [0, n).
Argument count (always ≥ 1; argv[0] exists).
Argument i; empty string out of range.
Read one line from stdin, trailing newline stripped; empty at EOF.
Read a whole file as bytes; empty slice on error.
Read a whole file as a string.
Create-or-truncate write; returns success.
Little-endian u32 at off.
Little-endian u16.
Little-endian signed i16 (sign-extended).
The per-frame auto-evicted arena.
A zero-initialized buffer of n elements — the core buffer primitive.
Empty map. Optional allocator context: stash.new[K,V](in: crib).
Insert / overwrite.
Lookup; the 2nd value is a found-flag.
Delete; returns was-present.
Entry count.
Empty growable vec.
Push.
Remove & return the last element.
Length.
Append a string's bytes (vec[u8] string builder).
Collect a vec[u8] into an owned str.
Length.
On a fixed array, mutate in place; on a vec, go through the handle.
Filter by a predicate function.
Map through a function.
Construct an error value.
Wrap an error, prefixing context ("ctx: msg").