Hello Folks!
A great fanfare and praise for the persistent bytecode. I just tried it on PyBoard and it works impressively. I'll check out more.
Will that also be available on WiPy?
Best Regards, Robert
Persistent Bytecode
Re: Persistent Bytecode
Thanks for the feedback! It would work on WiPy, but there everthing goes in RAM (including code and constants) so it wouldn't be that useful.
Re: Persistent Bytecode
Hello Damien. I did not try the variant where the bytecode is compiled into the package. Just the one where a pre-compiled file is loaded (to RAM) instead of the source file. And that should be useful for WiPy too, since it allows to run larger programs. The extra RAM space needed for compilation is saved.
Re: Persistent Bytecode
Ok, yes importing .mpy files from the filesystem would be possible on the WiPy and would help reduce RAM requirements. It's a single config option if Daniel wants to enable it.
Re: Persistent Bytecode
Hello Daimen, thanks for the reply. I have a question and a remark:;
Q: You said that a single config option would enable importing mpy files on WiPy. Is that something I could do myself, like in the mpconfigport.h file, and then rebuild the image? I have rebuilt the image a few times, that's easy enough.
R: When I call mpy-cross with the name of a non-existing file, I get the error message "MemoryError: lexer could not allocate memory". Needless to say that Murphy made this happen on my first attempt.
Regards, Robert
Q: You said that a single config option would enable importing mpy files on WiPy. Is that something I could do myself, like in the mpconfigport.h file, and then rebuild the image? I have rebuilt the image a few times, that's easy enough.
R: When I call mpy-cross with the name of a non-existing file, I get the error message "MemoryError: lexer could not allocate memory". Needless to say that Murphy made this happen on my first attempt.
Regards, Robert
Re: Persistent Bytecode
It should be enough to add this line:Roberthh wrote: Q: You said that a single config option would enable importing mpy files on WiPy. Is that something I could do myself, like in the mpconfigport.h file, and then rebuild the image? I have rebuilt the image a few times, that's easy enough.
Code: Select all
#define MICROPY_PERSISTENT_CODE_LOAD (1)
Now fixed.R: When I call mpy-cross with the name of a non-existing file, I get the error message "MemoryError: lexer could not allocate memory". Needless to say that Murphy made this happen on my first attempt.
Regards, Robert
Re: Persistent Bytecode
Hello Damien. Thanks a lot, that worked.
Robert
Robert