Keywords
betlang keywords mapped onto classic language constructs.
All 33 of betlang’s keywords are internet slang wearing the costume of a normal language construct. Each one compiles to exactly what you’d expect it to, because the compiler, for all its slang, has no sense of humor whatsoever.
Note
nocap and cap are the boolean literals (true and false). “No cap” is two words in real life, but
the lexer wanted one, so one it is.
Explicit type conversion: big as u8, f as int. Also renames an import: pull "a/b" as m.
Ties several forms together: cop … in crib, squad x in xs, holla r = t in crib, evict t in crib, t.trust() in crib.
Hand back the answer. Returns 0..n values: bet, bet x, bet a, ghosted.
A record type — "your data's outfit."
Declare a foreign C symbol: extern "C" finna abs(x: i32) -> i32.
A compile-time constant. It's facts — it doesn't change.
Declare a function ("finna do something"). Also heads a function-pointer type: finna(int) -> int.
A mutable, reassignable binding (type inferred or annotated).
A tagged union with payload and nullary variants.
Import a module (a sibling .bet file or a stdlib namespace).
Given an error value, return the zero values plus that error, collapsing the 3-line check.
A recover boundary: sheesh { … } naw p { … }. Rare/discouraged.
Spawn a concurrent task: slide worker().
Abort with a message: yeet("div by zero").
"cap" (a lie) — the boolean false.
The value that never showed up. The nil-error literal and the "not present" sentinel.
"no cap" — the boolean true (one word: the lexer wants nocap).
Allocate into an arena: cop Player{ hp: 100 } in frame.
Declare an arena: crib frame (untyped bump) or crib enemies: Enemy[1000] (typed slab).
Free a whole crib (evict frame, O(1)) or one slot (evict tag in crib).
Checked handle access with two arms: holla r = t in crib { …live… } ghosted { …dead… }.
Store a container of structs transposed: soa Particle[4]. Access is unchanged.
An 8-byte handle into a typed crib: tag Enemy. Plain copyable data.
The unchecked escape hatch: t.trust() in crib (ugly and greppable on purpose).
Dip out of the loop.
"for real?" — the true branch.
The negative branch. Also the wildcard arm in vibe matches and the recover arm of sheesh.
Skip to the next iteration.
Iterate over a collection (the whole squad).
Dispatch on a moods variant (exhaustive; naw is the catch-all).
Loop while the condition holds.
Show it off — exported from the module, or a public struct field.
Keep it quiet. The default when unmarked; can be written explicitly on a field.