Execution Model
Tick cycle, parallel semantics, termination, and scalar formatting.
Tick Cycle
The engine runs in ticks. Each tick:
1. Snapshot. All route conditions are evaluated against the current state of all holds.
2. Fire. Routes whose conditions all pass are marked as firing.
3. Execute. Each firing route executes its emits in order. Emits within a route are applied immediately - subsequent emits in the same route see updated values.
4. Advance. Through positions advance for routes that fired with a through clause.
5. Check. If the state hold reaches 2.0 or the done hold reaches 1.0, execution stops.
Parallel Semantics
All routes are evaluated against the same snapshot - the state at the start of the tick. So:
• Route A's emit to hold X is NOT visible to Route B's conditions in the same tick.
• Route A's emit to hold X IS visible to Route A's own subsequent emits in the same tick.
Intentional. Routes are parallel. Within a route, emits are sequential.
Termination
The engine stops when:
• A hold named state reaches 2.0 or higher
• A hold named done reaches 1.0 or higher
• The maximum tick count is reached (default: 5,000)
Scalar Formatting
Scalars are formatted as %.4f (4 decimal places): 1.0000, 3.5000, 0.0000.
GPU Execution
The runtime maps the organism onto CUDA cores. Neurons become threads, connections become memory reads, gates evaluate in parallel. Text operations run in VRAM. File I/O bridges to CPU, the only operation that leaves the GPU.
Examples
Echo
Read a file and print its contents:
circuit Echo {
hold src : memory text
hold state : memory scalar = 0.0
when start {
but state = 0.0
emit read_file("input.txt") to src
emit src to screen
emit 1.0 to state
}
}Character Scanner
Iterate through text character by character:
circuit Scanner {
hold src : memory text = "Hello VANA!"
hold state : memory scalar = 0.0
when scan {
but state = 0.0
through src
emit char to screen
}
}Conditional Accumulator
Add numbers until a limit is reached:
circuit Accumulator {
hold total : memory scalar = 0.0
hold step : memory scalar = 1.0
when add {
but total < 10.0
emit total + step to total
}
when done {
but total > 9.0
emit "Total: " to screen
emit total to screen
emit "\n" to screen
emit 2.0 to state
}
}Note: Five operators: <, >, =, <=, >=.
File Processor
Read, transform, and write:
circuit FileProcessor {
hold input : memory text
hold output : memory text
hold state : memory scalar = 0.0
when process {
but state = 0.0
emit read_file("data.txt") to input
emit replace(input, "old", "new") to output
emit write_file("result.txt", output) to screen
emit 1.0 to state
}
}