What's Different From Traditional Programming
For programmers coming from C, Python, and everything else.
If you've written code in C, Python, or most anything else, Sanguis works differently. Here's what changes.
What changes coming from C or Python
If you've written code in C, Python, or most anything else, here's the honest comparison.
Control flow
Sanguis has the control flow you know: if/else, while, and cells are functions. What it doesn't have: for (use while with a counter), switch (chain if/else), goto (deliberately absent: a jump is a conditional in disguise).
Data types
| Traditional | Sanguis |
|---|---|
| int, float, double | float (floating-point numbers) |
| string | string |
| bool | Use numbers (0.0 false, 1.0 true), or boolean circuits |
| struct with methods | organ with fields and cells |
| int[], arrays | list via grow_list |
Organs are the struct equivalent: declared fields, methods, and a manifest that travels with the compiled artifact.
Assignment
Inside cells, you assign directly: let x = 5; and x = x + 1;. On the GPU, an organ's field is a wire: writing it drives the wire, reading it senses the wire.
Parallel by default
In traditional languages, code runs sequentially. In Sanguis, the whole grid evaluates simultaneously: every switch, every wire, every pass.
| Traditional | Sanguis |
|---|---|
| Sequential execution | Parallel grid evaluation every sweep |
| Shared mutable state + locks | Snapshot semantics, no races |
| Threads, async, goroutines | Not needed: parallelism is the default |
| Manual synchronization | The engine handles it via sweep snapshots |
All switches see the same snapshot at the start of a sweep. One switch's change is not visible to another switch until the next sweep. Data races are eliminated by design.
No interpreter, no JIT, no runtime library
The program compiles into switch-and-wire data. The GPU kernel that runs it is fixed: the same kernel for every program. There is nothing to deploy alongside your program except the kernel itself.