Your First Virtual Machine: Write yourself a compiler, Part IV
In the previous article, we emitted an intermediate representation (IR) for our programming language that is easier to process than source code. However, we did not build a program that could read and execute that IR. Such a program is called a virtual machine. Technically, it’s still an interpreter. But instead of interpreting source code, it interprets IR. Our IR is binary, compact, structured, and generally faster to interpret than the original source. Moreover, as you’ll see later, the VM’s instruction set can express programs that our source language cannot produce yet!
