Virtual Machines differ from platforms in that a virtual machine may form the core of a platform. Virtual machines typically provide an environment for executing code (either a bytecode set unique to the VM or, in rare cases, compiled machine code) and often provide a set of services to that executing code, such as code-loading, execution access control and security, garbage collection, metadata access, and so on.
VM Implementation
Crafting Interpreters
Bytecode
See http://www.complang.tuwien.ac.at/forth/threaded-code.html for an introduction to threading techniques, including a performance comparison at http://www.complang.tuwien.ac.at/forth/threading/
Stack-based vs Register-based
This is often abstract variations of the register-vs-stack debate that CPUs engage in; generally a VM will either be entirely stack-based (using a virtual stack that may or may not correspond to the real stack), or entirely register-based (though often a stack is still present in a register VM, for other purposes).
Garbage collection
Much of this is going to be found in the reading on memory management. VMs typically offer some form of automatic memory management, since they can slightly intervene around raw pointer references and add either additional bookkeeping or indirection or "pointer fixups" to allow for objects to move around in memory w/o programmer awareness/knowledge.
Tutorials
Creating a VM/Compiler
Virtual machine in C ("felix.engineer"): six-register and stack
Terrence Parr: Simple Virtual Machine: Video and slides
Basic cpu: a register-based virtual machine in c | How to build a virtual machine from scratch | Create your own stack machine | Build your own virtual machine - Lexer | Build your own virtual machine - assembler | Build your own virtual machine - Finish the assembler | Build your own virtual machine - Finish up --all by Philip Bohun who has some additional videos
Simple Object Machine: A minimal Smalltalk for teaching of and research on Virtual Machines. Implementations:
Sites
Awesome Open Source: Top 137 Virtual Machine Open Source Projects
GitHub search for "virtual machine":
Detail Pages:
- 3BC-Lang Low-level language, tiny virtual machine, intermediate representation, embeddable, easy for beginners.
- aamachine A virtual machine for delivering interactive stories.
- ActionScript VM Actionscript virtual machine.
- AIR A cross-platform framework used by a wide range of applications and games.
- Apache.org The Apache site is a collection of numerous open-source projects, in all stages of life (incubating, maintained, archived).
- ArkScript A small, fast, functional and scripting language for C++ projects.
- ART (Android RunTime) The VM engine for the Android platform that replaced Dalvik around Android 5/6.
- BEAM VM Erlang virtual machine low-level details
- BIPLAN (Byte coded Interpreted Programming LANguage) An experimental compact programming language and virtual machinethat fits in less than 12KB of program memory and is implemented in less than 2000 lines of code.
- Bochs A portable IA-32 and x86-64 IBM PC compatible emulator and debugger mostly written in C++; it supports emulation of the processor, memory, disks, display, Ethernet, BIOS and common hardware peripherals of PCs.
- Build-Your-Own-X A collection of links on how to build various things as a learning exercise.
- Bytecode Alliance A nonprofit organization dedicated to creating secure new software foundations, building on standards such as WebAssembly and WebAssembly System Interface (WASI).
- Charly Fully parallel dynamically typed programming language.
- CLR A stack-based bytecode virtual machine.
- CLR FFI A collection of notes and links on .NET/CLR platform interop and native bindings.
- CLR Interoperability Links for the interoperability between the Common Language Runtime (CLR) and other platforms.
- CLR Specifications Specification links for the Common Language Runtime (CLR).
- CLR virtual machine/execution engine specifications A collection of the specifications for the runtime of the CLR platform.
- CoCo A virtual machine based on the Python virtual machine.
- Common Language Runtime (CLR) The execution engine and supporting structure for .NET programs.
- CoreCLR The VM implementation of .NET Core
- Core War A reproduction of the Core War game. Assembly compiler, Virtual Machine and GUI.
- CPython The original, "standard", C-based implementation of the Python language/platform.
- CPython VM The CPython virtual machine.
- Dalvik The virtual machine created for execution on Android devices.
- Dart An open-source, scalable programming language, with robust libraries and runtimes, for building web, server, and mobile apps.
- Dg A (technically) simple language that compiles to CPython bytecode.
- Dis The virtual machine behind the Limbo programming language for the Inferno operating system.
- Dolphin Smalltalk Dolphin Smalltalk language, vm, etc.
- DolphinVM Dolphin Smalltalk virtual machine.
- Dotnet Core CLR Open-source implementation of the CLR.
- Ecstasy (XTC) An object-ish language designed to be cloud native from the ground up.
- Event Processing Language (EPL) A language, compiler, and runtime for complex event processing (CEP) and streaming analytics.
- Free Programming Books A collection of free learning resources (books).
- Game Boy (Emulator/VM) A collection of links and articles on the Game Boy handheld game device.
- Glulx An interpreter for interactive fiction games written in Inform7.
- GNU MIX Development Kit (MDK) MIX is Donald Knuth's mythical computer as described in his monumental work The Art Of Computer Programming. As any of its real counterparts, the MIX features registers, memory cells, an overflow toggle, comparison flags, input-output devices, and a set of binary instructions executable by its virtual CPU.
- GNU Smalltalk The FSF implementation of the Smalltalk language/platform.
- GraalVM Polyglot VM from Oracle with support for a number of languages/platforms.
- Hercules An open source software implementation of the mainframe System/370 and ESA/390 architectures, in addition to the latest 64-bit z/Architecture.
- HHVM A virtual machine for executing programs written in Hack.
- HiggsJS VM Higgs JavaScript Virtual Machine. A JIT compiler for JavaScript targetting x86-64 platforms.
- HVM A pure functional compile target that is lazy, non-garbage-collected and massively parallel. It is also beta-optimal, meaning that, in several cases, it can be exponentially faster than most functional runtimes, including Haskell's GHC.
- IKVM A Java Virtual Machine and Bytecode-to-IL Converter for .NET.
- Java/JVM Platform The platform originally built by Sun for the Java programming experience, now expanded to include a number of languages, a ton of enterprise specifications, and hundreds if not thousands of popular libraries.
- Java Concurrency in Practice Goetz's seminal work on how concurrency works and operates on the JVM.
- Java Virtual Machine (JVM) The execution engine and supporting structure for Java programs.
- Jikes RVM A flexible open testbed to prototype virtual machine technologies and experiment with a large variety of design alternatives. Jikes RVM runs on many platforms and advances the state-of-the-art of virtual machine technologies for dynamic compilation, adaptive optimization, garbage collection, thread scheduling, and synchronization. It is self-hosted, i.e. its Java code runs on itself without requiring a second virtual machine. Most other virtual machines for the Java platform are written in native code (typically C or C++). A Java implementation provides ease of portability and a seamless integration of virtual machine and application resources such as objects, threads, and operating-system interfaces.
- JPC (Java PC) JPC is a fast modern x86 PC emulator capable of booting Windows up to Windows 95 (and windows 98 in safe mode) and some graphical linuxes; it has a full featured graphical debugger with time travel mode along with standard features like break and watch points.
- JVM FFI A collection of links and notes around JVM foreign function interface and native bindings.
- JVM Specifications Specification links for the Java Virtual Machine (JVM).
- Jython Python implementation on the JVM.
- LLJVM (Low Level Java Virtual Machine) A set of tools and libraries for running comparatively low level languages (such as C) on the JVM.
- LLVM A compiler and back-end native compilation/linking toolchain.
- Lua VM Implementation docs and notes for the Lua virtual machine.
- MAME A multi-purpose "vintage" software emulation framework.
- Maxine-VM A meta-circular research VM; a next generation, highly productive platform for virtual machine research..
- MedusaVM Aims at running pre-existing Python code without any or minimal modification at a much faster rates compared to the usual implementations by leveraging Dart and the DartiumVM.
- Memory Management and Garbage Collection (reading and references) Papers, books, and thoughts around manual and automatic memory management (GC).
- miniVM A small and fast cross-language Virtual Machine (VM) written in good ol' C, meaning it can compile and run just about anywhere.
- MoarVM A VM with adaptive optimization and JIT compilation, built for Rakudo
- MRI (Matz's Ruby Interpreter) The original fully-interpreted Ruby VM.
- Mun A programming language empowering creation through iteration.
- NanoVM A java virtual machine for the Atmel AVR ATmega8 CPU, the member of the AVR CPU family used e.g. in the DLR Asuro robot, manufactured by AREXX engineering.
- Neko (Language) A high-level dynamically typed programming language and virtual machine.
- Neko (VM) The NekoVM is a target for several compilers, including Haxe.
- Newspeak A language in the tradition of Self and Smalltalk, dynamic and reflective, but designed to support modularity and security.
- OMR Reliable components for building language runtimes.
- OpenJDK JVM A collection of links and reading specific to the OpenJDK.
- Open Smalltalk Cross-platform virtual machine for Squeak, Pharo, Cuis, and Newspeak.
- Papers We Love A collection of academic papers gathered by a popular "user group" dedicated to reading through them.
- Parrot Virtual machine implementation for Perl and other dynamic languages.
- Pawn A curly-brace language with a small-footprint VM. Represents data as 4/8-byte "cells". Compiles to CPU-specific bytecode.
- PearPC An architecture-independent PowerPC platform emulator capable of running many PowerPC operating systems, including pre-Intel versions of Mac OS X, Darwin and Linux.
- Pharo A dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
- Pixie A small, fast, native lisp with "magical" powers.
- PL/0 Language Tools An implementation of PL/0 including a tree-based interpreter and virtual machine.
- PLZoo (Programming Languages Zoo) The Programming Languages Zoo is a collection of miniature programming languages which demonstrates various concepts and techniques used in programming language design and implementation.
- Potion An object- and mixin-oriented (traits) language by _why the lucky stiff.
- Programming Dojo This site was designed to improve the awareness of different programming languages.
- Puter Cloud-hosted OS-like platform.
- PyPy A replacement for CPython, built using the RPython language that was co-developed with it.
- Q (Scripting Language) Q is a scripting engine that implements C-like language, compiler, and bytecode interpreter.
- Reactive Streams An initiative to provide a standard for asynchronous stream processing with non-blocking back pressure. This encompasses efforts aimed at runtime environments (JVM and JavaScript) as well as network protocols.
- Reading about Virtual Machines (implementation) A collection of interesting links and reading on VM-related topics.
- Redline Smalltalk Smalltalk implementation for the JVM.
- RPython A translation and support framework for producing implementations of dynamic languages, emphasizing a clean separation between language specification and implementation aspects.
- Rubinius A modern language vm that supports a number of programming languages.
- Scratch VM Virtual Machine used to represent, run, and maintain the state of programs for Scratch 3.0.
- ScummVM Classic VM environment for running graphical point-and-click adventure games and RPGs.
- Self An object-oriented programming language based on the concept of prototypes.
- Simple Object Machine A minimal Smalltalk for teaching of and research on Virtual Machines.
- Smalltalk The original object-oriented programming language, emphasizing multiple inheritance and message-passing.
- SmallVM A small, simulated virtual machine with a 32-bit instruction set. It also comes with a simple programming langauge called G, which has a modern Go language-like syntax (almost a strict subset), and a C-like semantics and runtime.
- Software reading A collection of reading about software.
- Squeak Open-source Smalltalk system.
- Squeak VM The VM for the Squeak implementation of Smalltalk.
- SSCLI Essentials by Stutz, Shilling, Pobar and myself on the Shared Source CLI, the predecessor to the .NET Core CLR.
- Strongtalk A bytecode-based virtual machine that formed the core of the modern JVM.
- SushiVM A JIT-enabled virtual machine and scripting interpreter.
- TADS Authoring system for writing Interactive Fiction.
- TopazRuby A high performance Ruby, written in RPython
- Tovie An Advanced Programming Language (Compiler + Interpreter + Transpiler ).
- Typhon A virtual machine for the Monte programming language.
- V8 Bytecode virtual machine for Javascript.
- vm86 A x86 script instruction virtual machine.
- VMIR (Virtual Machine for Intermediate Representation) A standalone library written in C that can parse and execute WebAssembly (.wasm) files and LLVM Bitcode (.bc) files; optionally it can generate machine code (JIT) to speed up execution significantly.
- Waba (JVM) A small, efficient and reliable Java Virtual Machine (VM) aimed at portable devices (but also runnable on desktop computers), written by Rick Wild of Wabasoft.
- WAMR (WebAssembly Micro-Runtime) a lightweight standalone WebAssembly (WASM) runtime with small footprint, high performance and highly configurable features.
- Wasp Lisp A member of the Lisp-1 family, borrowing principles from R5RS Scheme, Python and Erlang. It is a pragmatic language, designed to provide developers with tools to rapidly build network applications that require sophisticated logic and quick turnarounds between prototype and production.
- WebAssembly Virtual Machine WebAssembly virtual machine designed for use in non-web applications.
- YARV (Yet Another Ruby VM) The successor to the original Ruby VM (MRI).
- YASL (Yet Another Scripting Language)
- Zetavm Multi-Language Platform for Dynamic Programming Languages.
- Z-machine A specification and numerous engines for Infocom interactive fiction.
Last modified 14 April 2023