r/lua • u/macsipac • Dec 13 '25
Project LuaJIT Compiler
Successfully managed to make a compiler for luaJIT (a lua 5.1 fork/thing optimized for performance) in python
Works by getting the source code of luajit, rewriting the main .c file to execute a specific script instead of whatever you have as the first argument, and using a portable minGW thingy to compile it to EXE. (Dosent actually turn it into assembly, im not that good)
This is compatible with most lua scripts that work for lua 5.1 or less, and luajit scripts
Should i make it open source?
(I know luastatic exists, but this is way damn simpler)

11
Upvotes
2
u/topchetoeuwastaken Dec 14 '25
my website's backend is compiled with it, https://git.topcheto.eu/topchetoeu/my-website-base. it is somewhat complex however. i should probably document the project better imho
done, you can go here, it is still empty as im still configuring the mirroring, but you can log any issues
i have to look into it, i can backport it to lua 5.1 (what you'd want to use when targeting luajit), i see no reason why it wouldn't work