ivm-vm

Crates.ioivm-vm
lib.rsivm-vm
version0.1.0
sourcesrc
created_at2022-07-08 07:16:27.305426
updated_at2022-07-08 07:16:27.305426
descriptionThe virtual machine for ivm bytecode.
homepage
repository
max_upload_size
id621663
size8,526
Imajin (ImajinDevon)

documentation

README

The official virtual machine/instruction set for ivm.
See the ivm wiki on GitHub for more information.

What is ivm?

ivm is an experimental, well-documented, and expansion-ready virtual machine/instruction set written purely in Rust.

ivm provides a fairly medium level Instruction wrapper, which makes porting your language to ivm easier than imaginable.

Example

When combined with ivm-compile, we can achieve some pretty simple results with impressive ease.

let program_options = ProgramOptions::new(options::CCFV, MemoryPointerLength::X32b);

let instructions = [
    Instruction::Push(ReadOperation::Local(b"Hello, world!\n".to_vec())),
    Instruction::ExternCall(ivm_ext_x32::STDOUT_WRITE),
    Instruction::ExternCall(ivm_ext_x32::STDOUT_FLUSH),
];

let bytecode = ivm_compile::compile_all(&program_options, instructions);

let mut vm = VmInstance::init(program_options);

vm.introduce(bytecode);
vm.continue_execution().unwrap();
Commit count: 0

cargo fmt