VolkanaDEV

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.

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.