Thanks to visit codestin.com
Credit goes to github.com

Skip to content

idea: host MPY as front-end for attached board #6345

@jcw

Description

@jcw

MPY builds bytecode on-the-fly when in interactive mode:

$ micropython -v -v
MicroPython v1.12-483-g22806ed5d-dirty on 2020-05-29; darwin version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> print(1+2)
File <stdin>, code block '<module>' (descriptor: 7f9b5f506140, bytecode @7f9b5f506900 23 bytes)
Raw bytecode (code_info_size=7, bytecode_size=16):
 10 0a 07 00 ea 00 00 11 cd 00 00 11 7b 00 00 83
 34 01 34 01 59 51 63
arg names:
(N_STATE 3)
(N_EXC_STACK 0)
  bc=0 line=1
00 LOAD_NAME __repl_print__ (cache=0)
04 LOAD_NAME print (cache=0)
08 LOAD_CONST_SMALL_INT 3
09 CALL_FUNCTION n=1 nkw=0
11 CALL_FUNCTION n=1 nkw=0
13 POP_TOP
14 LOAD_CONST_NONE
15 RETURN_VALUE
3
>>>

Would it be an idea to extend the unix build to directly connect to a remote board over serial, so that MPY becomes an interactive front-end, with all the conveniences of staying on the host for development? As extra benefit, this would then also work with low-end boards which don't have the memory to support the compiler on-board.

What this would involve, I suspect - apart from the actual serial connection details - is that MPY needs to generate a complete module-like package, à la mpy-cross, with qstrings and constants and send that over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions