Compiling scripts into standalone .exe files

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
shi
Posts: 3
Joined: Wed Apr 12, 2017 2:07 pm

Compiling scripts into standalone .exe files

Post by shi » Wed Apr 12, 2017 2:19 pm

Is there a way to compile standalone .exe files for Windows with MicroPython as interpreter of choice? Something similar to PyInstaller / Py2exe but with MicroPython?

shi
Posts: 3
Joined: Wed Apr 12, 2017 2:07 pm

Re: Compiling scripts into standalone .exe files

Post by shi » Mon Apr 17, 2017 7:58 pm

Maybe someone has any ideas?

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

Re: Compiling scripts into standalone .exe files

Post by dhylands » Tue Apr 18, 2017 4:36 am

I'm not aware of any tools which currently do this, although since frozen byte code works, it's probably not too difficult to do with the unix or windows version.

shi
Posts: 3
Joined: Wed Apr 12, 2017 2:07 pm

Re: Compiling scripts into standalone .exe files

Post by shi » Wed Apr 19, 2017 4:18 pm

dhylands wrote:I'm not aware of any tools which currently do this, although since frozen byte code works, it's probably not too difficult to do with the unix or windows version.
Thank you! Will look into it. On the side note, is there any way to inspect Micropython's bytecode? Like dis module in Python 2/3?

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

Re: Compiling scripts into standalone .exe files

Post by dhylands » Thu Apr 20, 2017 12:56 am

I'm pretty sure that there isn't anything right now to do bytecode disassembly.

The code is in MicroPython (can be enabled), but nothing available in a convenient form. The current code (with the right debug stuff enabled) can dump bytecode for bytecode that was just compiled, but not for arbitrary bytecode.

@Damien helped me to write this: https://github.com/dhylands/upy-example ... te_code.py which reaches in and pulls out the natice code (which I could then disassemble externally).

Post Reply