Blockchain · zero-dependency · MIT

larzvm

A gas-metered stack VM.

A deterministic, gas-metered stack virtual machine — bigint stack, memory and storage, labelled jumps, hashing and events, with an assembler and disassembler. The smart-contract engine behind LarzChain.

larzscript pkg install vm
View on GitHub →Learn the stack

What you get

Try it

import "vm" as vm
let program = "PUSH 5\nPUSH 3\nADD\nSTORE x\nLOAD x\nEMIT result\nHALT"
let code = vm.assemble(program)
let result = vm.run(code, 1000)
print(result["stack"], result["storage"], result["events"], result["halted"])
print(vm.disassemble(code) == program)
Output
[8] {x: 8} [{name: result, value: 8}] true
true

Why it's in the Larz Stack

larzvm is a real Larzscript package (larzscript pkg install vm) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.