Official documentation on the MicroPython Language Architecture??

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
Posts: 1633
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia

Re: Official documentation on the MicroPython Language Architecture??

Post by jimmo » Fri Aug 30, 2019 10:50 am


I'm not sure what you're looking for exists, I know I would love to write such a thing if I had some more time. I did recently come across this which is a great start.

If you can let us know the sort of changes you'd like to make then I'm sure people on this forum can give you some pointers. Also if you have specific questions about how things work, then we can answer that too.

In the meantime, the unix port is quite a useful way to look into how things work. Start with main.c and look at how it sets up the MicroPython state and calls and starts the REPL.

Or if you start with the "minimal" port you can see the bare minimum to get micropython running which is also quite illustrative.

Each part of the language itself, the lexer, parser, VM, GC, native code generator, etc are confined to a relatively small number of files. One guiding principle that has served me well with learning the MicroPython code base has been that things mostly work the way you'd expect -- the only complication is that things are sometimes implemented in slightly strange ways for performance (especially memory) reasons.

Post Reply