-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Description
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
Labels
No labels