Interpreters
The official runtime is one C VM. For teaching — and for hosts where you do not want to compile C — we will publish exploded pieces: a lexer, a parser, an AST viewer, and a bytecode stepper. This page is the spec those tools will follow.
Reuse the real compiler
mpy-cross already turns source into .mpy on a desktop. A teaching VM can load that file and implement the opcodes in py/bc0.h. You get identical bytecode to the device without re-implementing the parser. That is the first interpreter we will ship.
From scratch
A second track parses a MicroPython-shaped subset in the browser and walks an AST — useful for syntax pages, not for running existing firmware. The internals page is the map of the C versions of both tracks.
What “MicroPython-shaped” means
- Python 3 syntax with the same indent rules.
- No multiple inheritance.
const(), and eventually native/viper as no-ops or as documented subsets.- A
machinefacade that can bind to an emulator’s pins.