Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Stack-based micro (< 150 LOC) virtual machine written in Ruby, running its own micro bytecode format called MC.

branch: master

first commit

latest commit c86c56b4b9
Josep M. Bach authored February 05, 2012
Octocat-spinner-32 .gitignore first commit February 06, 2012
Octocat-spinner-32 Readme.md first commit February 06, 2012
Octocat-spinner-32 add.mc first commit February 06, 2012
Octocat-spinner-32 functions.mc first commit February 06, 2012
Octocat-spinner-32 mc.png first commit February 06, 2012
Octocat-spinner-32 microvm first commit February 06, 2012
Octocat-spinner-32 stack_limit.mc first commit February 06, 2012
Readme.md

microvm

Sunday afternoon. One hour. Less than 150LOC (< 4kb).

MicroVM is a stack-based micro virtual machine written in Ruby, running its own micro bytecode format called MC.

MC Bytecode

Install

$ wget https://raw.github.com/txus/microvm/master/microvm
$ chmod +x microvm
$ ./microvm some_file.mc

You can try some example MC files in this very repo.

Why?

It's a learning example: it's a really simple implementation of a VM that works, so it's easy to get a general grasp about how things are structured.

Features

  • Compact bytecode format (although it could be more compact)
  • Method calls
  • Types: only String and Fixnum for now.
  • Sort of runtime type checking

Who's this

This was made by Josep M. Bach (Txus) under the MIT license. I'm @txustice on twitter (where you should probably follow me!).

Something went wrong with that request. Please try again.