How an interpreter works
How Ignition executes bytecode instructions and produces a function's result.
In the previous lesson, we generated bytecode from an AST. Now Ignition reads that bytecode and performs the specified operations one at a time.
Each instruction has a handler: the part of the interpreter that performs its operation. The CPU executes the machine code of Ignition’s handlers.
Consider the function add(a, b), which returns the sum of its arguments. When called as add(2, 3), its instructions first load 2, then add 3, and return 5.