ivm-vm 0.1.0

The virtual machine for ivm bytecode.
Documentation
  • Coverage
  • 10%
    2 out of 20 items documented0 out of 10 items with examples
  • Size
  • Source code size: 8.43 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.78 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ImajinDevon

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();