4 ms·
You don't have to do it this way, but it looks like the code to be interpreted is normally compiled to bytecode stored in a constant in a C header. So it's all
by skybrian 3y ago
You don't have to do it this way, but it looks like the code to be interpreted is normally compiled to bytecode stored in a constant in a C header. So it's all in flash anyway, and you'd update the flash the same way as changing C code.
If you're going to do that, why not generate C and skip the interpreter? Is it because bytecode is more compact than native code?
I guess there would still need to be a runtime to handle array memory garbage collection.
- woodrowbarlow 3y ago> stored in a constant in a C header i think this is just because a loader isn't included and that's the minimum example. in a real project you'd write your own code to load the compiled bytecode from somewhere else (external storage, or fetch from server, or w/e). i.e., here's an interpreter you can bolt onto your firmware codebase. it has no dependencies and makes no assumptions.