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
alidayvn
Posts: 1
Joined: Fri Aug 30, 2019 8:34 am

Official documentation on the MicroPython Language Architecture??

Post by alidayvn » Fri Aug 30, 2019 8:35 am

Hello Everyone!!

I have been exploring micropython on PyboardV1.1 and it's been a while. Right now , I have been trying to understand :? the architecture of the whole project/repo/language(excuse me for this notion, since I'm not sure on how to call this) and at some point in time it might happen for me to write my own libs. :roll:

Can someone explain on where should I look into , such that I could understand the complete architecture of the project and make the relevant changes in order to suit my development needs. :)

Please excuse me if I had missed out any obvious links or forums that already has an answer for this.!!

Thanks in advance, :P

User avatar
jimmo
Posts: 553
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

Hi,

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 https://micropython-dev-docs.readthedocs.io/en/latest/ 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 main.py 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