micropython origins?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
miltmobley
Posts: 30
Joined: Mon Mar 07, 2016 11:44 pm

micropython origins?

Post by miltmobley » Fri Nov 20, 2020 7:34 pm

I am curious what version of cpython the original micropython is based on.

And does current micropython track changes made to cpython since then?

I am interested in studying changes made to create micropython, but only in the py folder,
e.g. lexer/scanner/parser/bytecode interpreter.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: micropython origins?

Post by dhylands » Fri Nov 20, 2020 7:55 pm

The original Kickstarter for MicroPython can be found here: https://www.kickstarter.com/projects/21 ... ontrollers

It says that it follows the "Python 3.3 grammar and language semantics"

The very first commit was made to the repository in Oct, 2013.

This page: http://docs.micropython.org/en/latest/genrst/index.html says that if currently "implements Python 3.4 and some select features of Python 3.5".

stijn
Posts: 735
Joined: Thu Apr 24, 2014 9:13 am

Re: micropython origins?

Post by stijn » Fri Nov 20, 2020 7:56 pm

MicroPython was written completely from scratch so it is not based on CPython.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: micropython origins?

Post by pythoncoder » Sat Nov 21, 2020 10:27 am

dhylands wrote:
Fri Nov 20, 2020 7:55 pm
...
This page: http://docs.micropython.org/en/latest/genrst/index.html says that if currently "implements Python 3.4 and some select features of Python 3.5".
That ref is slightly out of date. MicroPython now includes some features from 3.8 including the "walrus operator" and elements of uasyncio.
Peter Hinch
Index to my micropython libraries.

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: micropython origins?

Post by mattyt » Sat Nov 21, 2020 10:55 am

Although originally using 3.3 (then, later, 3.4) as a baseline, MicroPython now contains a mix of features from various Python releases. For example, v1.13 includes the assignment (walrus) operator, described in PEP 572 and introduced in Python 3.8. Generally, most features will be considered, the barrier to entry is to find a resource-efficient way to implement a feature with acceptable levels of compatibility with CPython.

It's also worth noting that there are a couple of issues discussing Python 3.5 and Python 3.6 support.

Finally, you might want to take a look at Damien talking about The Early Days of MicroPython last year on MicroPython's sixth birthday.

Post Reply