Reference

std/machine

The kernel the bytecode VM of torb run --vm runs on: raw 64-bit words, and the C runtime behind them (docs/design/VM.md section 6).

The VM keeps its registers in one ArrayList<Int64>, and a value there is the runtime's own bytes - a String is the two words of a torb_text, a list the two of a torb_list, a counted block its pointer. Machine is what does the part TorbScript cannot do on such words: call a function of the runtime with them, read and write a word of a counted block, and place a text or a float constant into them.

This package is not for programs. Its operations trust their operands the way machine code does - a wrong register or address is a wrong write, not a panic - and a sandboxed script never gets it, because a sandbox's capabilities are its imports.

Modules

Everything