Running programs
Main components of the virtual machine are:Value stack - keeps working values of the program; Call stack - keeps function calls and execution information; Globals - stores global variables; IO - references the IO channels to perform IO operations; Trace - pluggable VM execution tracing; The virtual machine accepts a Chunk of bytecode and begins the execution.Before running the program the call and value stack is empty, as well as the globals map.When execution starts, the VM creates a main Call Frame and places in on top of the Call Stack. The call frame stores the pointer to the value stack base (always 0 when virtual machines just starts). It also keeps reference to a currently active chunk and the chunk instruction pointer.The VM loads the instruction pointed via the IP of the active call frame and executes it.