Swamp Documentation

Official documentation for the Swamp programming language

Swamp is a systems programming language designed for games and real-time servers.

  • Persistent game state lives in fixed, trivially copyable containers –— no heap allocation during a tick, no garbage collection, no surprises.
  • Iteration speed: Swamp is designed to compile fast and reload in-place, so the feedback loop between a code change and seeing it run stays as short as possible.

Swamp code compiles to Marsh VM bytecode and, in the future, directly to native machine code.

👉 Install it now!

Key ideas

  • Compile-time allocation. All memory is reserved upfront, no runtime allocation. No GC, no allocation jitter, no memory leaks.

  • Deterministic by design. The same input always produces the same output — ideal for rollback, replay, and lockstep netcode.

  • Trivially copyable game state. Application state contains no pointers. The entire simulation can be snapshotted, diffed, or restored with a memcpy.

  • Static safety without a runtime. Strong typing and scoped borrowing catch errors at compile time. No garbage collector, no runtime exceptions.

  • Hot reloading. Compiles quickly to compact Marsh VM opcodes that can be swapped in-place without losing state, enabling fast iteration.

  • Transparent execution. Swamp has syntactic sugar — a for loop expands to a while loop with a counter. You can always reason about what a line of code costs in performance.

  • Terse, readable syntax. Short keywords, short standard library names. Dense without being cryptic — code stays scannable even in tight tick logic.

  • No import ceremony. Collections, logging, and asserts are always in scope.