feat(runtime): embed platform modules as bytecode

ui.lua and hints.lua are compiled to LUA_32BITS bytecode (matching the
firmware's Lua build) and linked into the binary. A new package.searchers
entry checks them as the fallback after the SD card, so a local
/.lua/lib/ui.lua still shadows the packaged one for debugging.

Bytecode is ~40% smaller than source and loads without parsing. A fresh
SD card with no make sdcard now has the platform available.
This commit is contained in:
2026-08-03 21:08:35 -04:00
parent 60ec720cdb
commit 6a9b082f97
10 changed files with 430 additions and 263 deletions
+1
View File
@@ -128,6 +128,7 @@ class Runtime {
bool loadScript(const std::string& path);
void installLoader(const std::string& appDir);
static int searchModule(lua_State* state);
static int searchEmbedded(lua_State* state);
static int loadFile(lua_State* state);
// A batch is one visit to the app, however many callbacks it fans out into: a tap fires