VolkanaDEV

What's Different From Traditional Programming

For programmers coming from C, Python, and everything else.

What 4.0 changes

Here's what's new in 4.0:

The circuit grids are back in 4.0, running the same 3.9 engine: wire, truth, trace, vana, grid, press, insert, play, pulse. Fleets also run on every core now, with the same output as on one.

If you've written code in C, Python, or most anything else, Sanguis works differently. Here's how.

What changes coming from C or Python

Control flow

Sanguis has the control flow you know: if/else, while, and cells are functions. Loops are written with while and for item in list. Branches use if/else and when. There's no switch (chain if/else instead) and no goto. strain gives you tagged data, break exits a loop, resume continues it, and close ends a spawned task.

Data types

TraditionalSanguis
int, float, doublefloat (floating-point numbers)
stringstring
booltrue and false, and 0.0 and 1.0 read the same way
struct with methodsorgan with fields and cells
int[], arrayslist, written [1.0, 2.0, 3.0]

Organs are Sanguis's structs. They have fields and cells, and the compiled file carries a description of them.

Assignment

Inside cells, you assign directly: let x = 5; and x = x + 1;. On the graphics card, an organ's field is a wire. Writing to it drives the wire, and reading it senses the wire.

Parallel by default

Most languages run one line after another. In Sanguis, fleets run on every core at once: each cell ticks in parallel, and messages arrive on the next tick in the order they were sent.

TraditionalSanguis
Sequential executionFleets split across every core, same bytes as one core
Shared mutable state + locksSnapshot semantics, no races
Threads, async, goroutinesNot needed: a fleet is the parallel unit
Manual synchronizationThe engine handles it via sweep snapshots

At the start of a tick, every cell sees the same picture. A message one cell sends doesn't arrive for the others until the next tick, so cells can never race each other.

One kernel, programs as data

A compiled program is text you can open and read. The same file runs the same on Windows and Linux, and the compiler rebuilds itself to the same bytes, which sanguis verify checks on your machine.