Sanguis Documentation
Parallel-First Programming
Sanguis is a parallel-first programming language. Programs are not sequences of instructions. They are collections of routes that fire simultaneously, settle against conditions, and produce output. There is no main(), no call stack, no sequential execution.
A Sanguis program describes:
• Holds, named values (scalars or text)
• Routes, triggered blocks that check conditions and emit values
• Ticks, the engine advances one tick at a time, evaluating all routes in parallel
Design Principles
• Parallel by default. All routes evaluate every tick. There is no sequential ordering.
• Implicit control flow. No if, for, while, or return. Conditions gate routes. Routes loop by firing repeatedly until conditions fail.
• Two data types. Scalars (floating-point) and text (strings). No ints, no structs, no classes.
• Settling, not stepping. The programmer describes state and rules. The engine settles the system tick by tick until it reaches a terminal state.
• GPU-native. The runtime executes the entire organism on CUDA cores. The GPU is not an accelerator. It is the processor.
Getting Started
Prerequisites, runtime binaries, hello world, and your first program.
Language Reference
Nine keywords: circuit, hold, memory, when, but, emit, append, through, wire. Grammar, operators.
Builtins
What makes Sanguis different from C, Python, and everything else.
Execution Model
Tick cycle, parallel semantics, termination, and scalar formatting.
Examples
Circuits, holds, routes, conditions, emit, append, through, and wire, with examples.
Compiler Pipeline
How Sanguis programs compile and run on the GPU.
Marrow Terminal
The built-in editor and runtime. Keybindings, panels, and pipeline.
Glossary
Terms and definitions.
One command. Write .sang, run sanguis_run.bat program.sang, get output. The compiler and runtime are invisible.