VolkanaDEV

Builtins

The functions that come with the language.

Builtins are functions you can use without writing them yourself. The 4.0 compiler knows 301 of them, up from 74 in 3.9. This page lists the ones the kit tests on your machine.

Text and files

BuiltinWhat it does
printWrite a value, one per line
len, char_at, concatMeasure, read and join text
str_sliceA piece of a string
read_file, write_file, read_bytesFiles
out_capture, out_takeCapture what a program prints
str_hex, str_unhex, str_byte, str_xorByte helpers
str_sum, str_bytes, str_words, words_strMeasurements and conversions

Math

BuiltinWhat it does
abs, floor, sqrtAbsolute value, round down, square root
max, min, modLarger, smaller, remainder (mod by 0 is 0)

System cell operations

Inside a system cell, these work in the cell's own type, the one after its ->.

GroupOperations
Arithmetic and compareiadd isub imul idiv imod iand ior ixor ishl ishr ieq ine ilt ile igt ige ineg
Logic and shifts (float cells too)band, bor, bxor, shl, shr
Typed memoryload8 to load64(p), store8 to store64(p, v)
Conversionsto_u64, to_i64

Roles

A cell can take on a job with cell assign. Each job comes with its own builtins:

RoleBuiltins
Stemsdifferentiate, undifferentiate
Taggers and prunerstag_NAME, prune_NAME
Immune guardsawaken_NAME, summon_NAME, patrol, quarantine
Tasksrun_all, kill, task_state, task_steps, sleep_ticks, wait_key

Inside Sanguix

The compiler also knows the builtins that Sanguix, our operating system, provides. They cover graphics, WebAssembly, encryption, devices and memory, the web engine, pictures and erasure codes. Use a hardware one outside Sanguix and you get an error that names it.