compile .py to .mpy on the board

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Picasso
Posts: 39
Joined: Fri Mar 22, 2019 12:13 pm

compile .py to .mpy on the board

Post by Picasso » Fri Mar 22, 2019 2:03 pm

At a company digi they have the xbee cellular modem board. See:
https://www.digi.com/resources/document ... _files.htm

Their doc describes a uos.compile() function that compiles .py files into .mpy files on the board itself.
To me this sounds interesting, since it would enable users to create mpy files, compatible with their boards, without having to be able to build micropython and the cross over compiler.
Would this be something that adds value to MicroPython?

cefn
Posts: 230
Joined: Tue Aug 09, 2016 10:58 am

Re: compile .py to .mpy on the board

Post by cefn » Fri Mar 22, 2019 8:54 pm

See these issues for dynamically bytecode-compiling .mpy files on the filesystem ready to be loaded into RAM...
https://github.com/micropython/micropython/issues/2709
https://github.com/micropython/micropython/issues/4187

...and these issues for loading dynamically generated .mpy structures into executable flash for ESP8266, skipping RAM
https://github.com/micropython/micropython/issues/3681
https://github.com/micropython/micropython/issues/4124

Picasso
Posts: 39
Joined: Fri Mar 22, 2019 12:13 pm

Re: compile .py to .mpy on the board

Post by Picasso » Sun Mar 24, 2019 4:49 pm

Ok, I see. Although a good idea, it was not that original. Majority of the implementation is already done (reading damiens' comment), glueing it together in the proper way using the proper methods is the remaining part.

My guess is that this issue is not done yet since it does not have suifficient priority. This brings me to a next question ( I will start a new topic on this), and that is "what is the target audience for micropython?".

Post Reply