Skip to content
duangsuse edited this page Jan 7, 2018 · 4 revisions

Min Virtual Machine Specification VM Language

MinVM is a Virtual Machine for Min Programming Language (which is still developing now)

that runs blazingly fast, prevents segfaults, and guarantees thread safety

that runs extreme slow, generate Exceptions, and has no multi-threading API not thread safe

and gives you extreme-small runtime for Min Programs(or other language that compiles to MinVM Assembly)

MinVM is a register-based High Level Language Virtual Machine (HLLVM), like ParrotVM, BeamVM, and what MinVM depends on, the JVM.

Basic design 📓

MinVM has 4 registers and 1 stack (for passing arguments) and 2 internal stack. MinVM also has a global ENV(Hashtable<int, Object>) to store Objects.

registers

  • ax: A Register <Object>
  • bx: B Register <Object>
  • cx: C Register <Object>
  • rx: FFI Call Result Register <Object>
  • ex: Exception Register <Exception>
internal registers
  • pc: Program Counter <Integer>
  • asp: Argument Stack Pointer <Integer>
  • csp: Call Stack Pointer <Integer>
  • esp: Scope Stack Pointer <Integer>

stacks

  • as: Argument Stack <Array<Object>>
  • cs: Call Stack <Array<Integer>>
  • es: Scope Stack <Array<Scope>>

Features ⭐️

  • Small! Excited Runtime Size < 100k (smaller than Lua5.3)
  • Excited! One Compiler (maybe) for all VM/Language APIs
  • Runtime written in Java, Ruby, C#, C(JNI) and (maybe) in Min (meta-circular)
  • AOT Compiler(to Java .class) and (maybe) (with less feature) (much much later) to LLVM IR
  • Excited Performance ([Lmin/vm/internal/OpCode and [I interpreted) (maybe)
  • Excited support for languages like Lice
  • Excited support for the reflect API
  • Focus on running small utilitie programs, small Android Apps

Other resources 🎁

See wiki

License ⚠️

minized-lang/MVM is licensed under the GNU General Public License v3.0

LICENSE

(Not a serious VM spec. (and VM) just for fun 🌚 )