Sanguis Documentation
The language, and the machine it compiles to.
Sanguis is the language you write; BloodCode is the machine it compiles to. Programs are written as circuits of organs and cells, compile to a frozen instruction set, and run bit-for-bit identically on every machine.
A Sanguis program describes:
• Organs, self-contained structures with fields and cells, lowered into the grid as switch-and-wire data
• Cells, functions that transform values; the whole grid evaluates in sweeps, not steps
• Sweeps, the engine advances one sweep at a time, evaluating every switch and wire simultaneously until the grid settles
Design Principles
• Parallel by default. Every switch and wire evaluates against the same snapshot each sweep. There is no sequential ordering inside a sweep.
• Familiar control flow. if/else, while, for/in, and return all work the way you expect. The parallel semantics apply underneath, not instead.
• Organs and cells. Fields hold state; cells transform values. Organs compile into the grid with their fields as declared state and their methods as wiring.
• Settling, not stepping. The programmer describes state and rules. The engine settles the grid sweep by sweep until it reaches a stable state.
• Deterministic. The same program produces bit-for-bit identical results on every machine: the graphics card, the just-in-time executor, and the compiler that compiles itself.
Getting Started
Prerequisites, runtime binaries, hello world, and your first program.
Language Reference
The keywords, grammar, condition operators, and comments. One page, current to the 3.0 surface.
Builtins
The functions the engine provides, grouped, with what each one returns.
What's Different
What changes coming from C, Python, or anything else.
Execution Model
Sweep cycle, parallel semantics, termination, and scalar formatting.
Examples
Circuits, organs, cells, control flow, and the builtin surface, 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.
Two commands. bleed compiles your source into BloodCode. ad --target vulkan pours it into the grid and settles it on your GPU. The intermediate file is readable text.