3 ms·
What’s the Lua/LuaJIT story these days for bundling up all the scripts of an application into a single file? Is there a way to do the super convenient go-like
by JSR_FDED 4mo ago
What’s the Lua/LuaJIT story these days for bundling up all the scripts of an application into a single file? Is there a way to do the super convenient go-like thing?
- gucci-on-fleek 4mo agoI personally use a hand-written C wrapper program (which is not much more than a dozen lines long), and then embed the Lua scripts using objdump. This isn't quite as easy as Go since cross-compiling C programs is often somewhat tricky, but Lua is very portable and has zero dependencies, so it's usually not too hard.
- zdragnar 4mo agoThere's a bunch of options from a Google search, but embedding it in a thin C program and building that with https://github.com/jart/cosmopolitan https://github.com/jart/cosmopolitan would be a pretty go-like experience, I'd think.
- orthoxerox 4mo agoThere was a Lua[JIT] fork called Idle that seems to have fallen off the face of the Earth that did exactly that: it would take a small stub program, a runtime library and all the scripts and package them into a single PE/COFF binary that would read itself when run. Love2D does it as well: zip -9 -r SuperGame.love . cat love.exe SuperGame.love > SuperGame.exe This doesn't work with ELF files, though.