Bbetlang

Overview

What bet is, and the three kinds of names you'll meet.

bet is a compiled, statically-typed language that talks like your group chat and runs like it has a job. Every keyword is a piece of internet slang in a tiny business suit: finna is fn, cop allocates, holla reaches into memory, yeet panics. It reads like nonsense and behaves like C. The syntax is doing a bit; the compiler did not get the memo, and lowers every last sheesh to the same cold, efficient machine code your more respectable friends’ languages produce. Underneath sits a Rust frontend and IR over an LLVM backend, plus a matching interpreter that plays correctness oracle, so whatever bet run prints, the compiled binary prints right back, byte for byte, deadpan.

These docs describe the language as it actually exists today, not the gorgeous imaginary version living in some design doc. Everything here is scraped straight out of the compiler: the lexer’s keyword set, the IR’s type table, the intrinsic dispatch. If a feature got dreamed up but hasn’t shipped, it doesn’t get a paragraph here, no matter how badly it wants one. Which is the fun way of saying: everything on this page compiles and runs.

Three kinds of names

Three kinds of name come up constantly, and mixing them up is a great way to confuse yourself for twenty minutes, so keep them straight:

Kind What it is Redefinable?
Keyword A reserved word the lexer recognizes (finna, holla, cop, and so on). No, it’s reserved.
Built-in type name A predeclared type or type constructor (int, str, f32x4, stash[K, V]), resolved by the frontend rather than the lexer. Shadowable in principle, but don’t.
Intrinsic A stdlib call the compiler lowers directly (spill.it, math.cook, gg.rect). Neither a keyword nor importable source. The namespace is reserved.

A few words moonlight in more than one place, on purpose: tag, crib, and soa are keywords that also show up in type position (tag Enemy), while mem and vec each pull double duty as an intrinsic namespace and a type constructor.

Where to go next

  • Syntax: operators, literals, comments, and statement termination.
  • Keywords: all 33 reserved words.
  • Types: every type name and constructor.
  • Arenas: the memory model, and the part that makes bet more than a slang generator.
  • Standard library: the built-in intrinsics.