I can suggest you to take a look at https://github.com/luvit/luvi wich in fact "pack" your lua program and the lua interpreter into an executable (5 Mo is the smallest executable size). Plus, you get to have neat libraries too, including luv, pcre, openssl, zlib.
It use luajit as the lua interpreter, so you'll have to adapt to lua5.1 I guess, but luvi provide "bit" which let you make bit operation, a missing part of lua5.1.
As much as I'm a big fan of Luvi, and I use it for several projects (including LyraScript), I wouldn't recommend it just for the purpose of creating a self-executable. After all 5 megabytes is huge compared to the size of the LuaJIT interpreter alone which is 10x smaller.
Of course, it's great if you need the additonal feature set. But otherwise there's really no point in bundling everything, since that just adds unnecessary bloat.
You can find releases here: https://github.com/truemedian/luvit-bin/releases Then check the github https://github.com/luvit/luvi#usagethe usage is really simple, you put you file in a folder, name it "main.lua" and then can call "luvi . -o myapp.exe", which will pack everything and output your executable at "myapp.exe" (you can use another name)
I've been using Enceladus for the past year. It arguably creates the smallest binaries, since it literally just packs the Lua 5.1 interpreter along with the Lua scripts into a self-executable bundle. For example check out my RPAN Chat Archive program
3
u/lilevil_ Sep 02 '23 edited Sep 02 '23
I can suggest you to take a look at https://github.com/luvit/luvi wich in fact "pack" your lua program and the lua interpreter into an executable (5 Mo is the smallest executable size). Plus, you get to have neat libraries too, including luv, pcre, openssl, zlib.
It use luajit as the lua interpreter, so you'll have to adapt to lua5.1 I guess, but luvi provide "bit" which let you make bit operation, a missing part of lua5.1.
2
u/rkrause Sep 03 '23 edited Sep 03 '23
I've been using Enceladus for the past year. It arguably creates the smallest binaries, since it literally just packs the Lua 5.1 interpreter along with the Lua scripts into a self-executable bundle. For example check out my RPAN Chat Archive program
https://github.com/sorcerykid/rpan_chat_archive/tree/master/bin
As you can see, it resulted in a Windows executable of just 154 kB!
Here's the entire Lua source:
https://github.com/sorcerykid/rpan_chat_archive/tree/master/src
1
u/HuntFirst5569 Oct 15 '26
pip install lua-to-exe in cmd :)
0
u/[deleted] Sep 02 '23
[deleted] — view deleted comment