I am looking to use Wren on a microcontroller. I have done a quick and dirty test to prove that it runs and that reasonable enough scripts can run within the limited memory, however since I want to load scripts from an SD card I am left with an issue:
I don't want to waste precious RAM to load the script into ram, just to have it compiled (at run time on a 80Mhz CPU), so it can run.
I am giving the VM 50K (out of 64), but that means I don't have a lot of space left over for buffers and strings and such.
So what I would really like is a way to stream compiled bytecode into the system.
I may try an tackle this myself. It occurs to me that the "cheap and easy" way to tackle this might be to load and compile the source, and then save the VM as a binary that can be loaded. This isn't as ideal as having a wrenc compiler (ala luac), but it would be a useful first step.
Are there any impediments to this working, such as address fixups when saving/loading or the like?
I am looking to use Wren on a microcontroller. I have done a quick and dirty test to prove that it runs and that reasonable enough scripts can run within the limited memory, however since I want to load scripts from an SD card I am left with an issue:
I am giving the VM 50K (out of 64), but that means I don't have a lot of space left over for buffers and strings and such.
So what I would really like is a way to stream compiled bytecode into the system.
I may try an tackle this myself. It occurs to me that the "cheap and easy" way to tackle this might be to load and compile the source, and then save the VM as a binary that can be loaded. This isn't as ideal as having a
wrenc
compiler (alaluac
), but it would be a useful first step.Are there any impediments to this working, such as address fixups when saving/loading or the like?