A compiler and virtual machine for a toy imperative language