11 releases
0.2.2 | Nov 16, 2018 |
---|---|
0.2.1 | Nov 15, 2018 |
0.1.91 | Nov 14, 2018 |
#169 in #register
28 downloads per month
Used in 2 crates
50KB
1.5K
SLoC
Jazz Virtual Machine
Jazz is a register-based virtual machine
VM is still in active develop so it's not recommended to use Jazz for your purposes
Example code:
LoadInt(0,12) // Load 12 into R(0)
LoadInt(1,3) // Load 3 into R(1)
Add(2,1,0) // Add value from R(1) to R(0) and store result in R(2)
Ret(2) // Return value from R(2)
Jazz is heavily inspired by Gravity language VM
Simple Jazz
Library used for easy generating JazzVM code,example:
fn add_op(node: Node,b: &mut FunctionBuilder) {
visit(node.left,b);
visit(node.right,b);
let r3 = b.register_pop();
let r2 = b.register_pop();
let r1 = b.register_push_temp();
b.insert_op(Instruction::Add(r1,r2,r3));
}
lib.rs
:
Jazz Virtual Machine
Jazz is a register-based virtual machine
Jazz is still in active develop so it's not recommended to use Jazz for your purposes
Example code:
LoadInt(0,12) // Load 12 into R(0)
LoadInt(1,3) // Load 13 into R(1)
Add(2,1,0) // Add value from R(1) to R(0) and store result in R(2)
Ret(2) // Return value from R(2)
Jazz is heavily inspired by Gravity language VM
Dependencies
~0.6–1MB
~15K SLoC