DocsBytecode

Bytecode

A woven script starts with the bytes "WF" and a version, then a constant pool (numbers as 64-bit floats, strings as UTF-8), then its functions. Function 0 is the script itself. Each op is one byte; operands follow little-endian.

OpsOperands
constu16 constant
nil, true, false, pop, dup—
load, storeu8 depth, u8 slot
builtinu8 id
add, sub, mul, div, mod, idiv, pow, neg, not, concat—
eq, ne, lt, le, gt, ge—
jmp, jf, jfk, jtk, jnki16 offset
callu8 argument count
ret—
closureu16 function
list, mapu16 count
index, setindex, index1, setindex1—