Build a stack machine

The loop every chip runs: read the next instruction, work out what it wants, do it, go back for the next. This lesson writes that same loop as a few dozen lines of Go, and then makes it run real programs.
Before you start. A chip runs one loop forever: fetch the next instruction, decode which operation it is, execute it, with one number (the program counter) saying where the next instruction sits, and a jump being nothing more than writing a new number there (The CPU (fetch-decode-execute, the ISA, assembly)). A compiler turns the words you write into those instructions, some languages stop halfway at a portable in-between code that a small program reads, and a function call leaves a note saying where to come back to (How Code Becomes Execution (compilers, stack & heap)). You need Go installed to run the code; reading it needs nothing.