Busy Developer's Guide to Building A Virtual Machine

ted@tedneward.com | Blog: http://blogs.tedneward.com | Twitter: tedneward | Github: tedneward | LinkedIn: tedneward

Objectives

Building a virtual machine

Architecture

Major moving parts of most virtual machines

Architecture

Architecture (simplified)

Bytecode Operations

A quick primer

BytecodeOps

All assembly-level languages share some characteristics

BytecodeOps

Opcodes take operands (parameters)

BytecodeOps

Operations fall into categories

BytecodeOps

Operations fall into categories

Stack-based Virtual Machines

Everybody on, everybody off the stack

Stack VMs

Stack-based virtual machines

Register-based Virtual Machines

How many registers do you need?

Register VMs

All storage/work is in registers

Register VMs

No-operand opcodes:

Register VMs

Basic value-manipulation opcodes:

Register VMs

Mathematical ops

Implementation

Build it already!

Implementation

Steps (1/2)

Implementation

Steps (2/2)

Summary

Wrapping up

Implementation

Futures

Resources

Where to go to get more

Resources

VM implementations to study

Resources

Books

Resources

Web

Credentials

Who is this guy?