luajit2(1)
π NAME
okay so bestie, meet luajit2 β it's OpenResty's maintained branch of LuaJIT. that's the whole vibe. β¨
π SYNOPSIS
luajit2 [options]... [script [args]...]
π¦ WEB SITE
the mothership, fr: https://github.com/openresty/luajit2 π
π DESCRIPTION
okay so real talk: this right here is the command-line program that runs your Lua programs with LuaJIT2. π«Ά
LuaJIT2 is a just-in-time (JIT) compiler for the Lua language β like, it watches what your code is doing and then speeds it up on the fly. iconic behavior honestly. the virtual machine (VM) is based on a fast interpreter combined with a trace compiler. it can significantly improve the performance of Lua programs. not me being obsessed with a bytecode compiler π
and here's the slay part: LuaJIT2 is API- and ABI-compatible with the VM of the standard Lua 5.1 interpreter. so when you're embedding the VM into an application, the built library can be used as a drop-in replacement. literally just swap it in. no cap. π
β¨ OPTIONS β¨
here's the full menu, bestie β every single one, no skips:
-echunk β run the given chunk of Lua code. one-liner core π-llibrary β load the named library, just likerequire("library"). same energy, shorter typing. π-b ...β save or list bytecode. run it with no arguments to get help on options β it'll tell you what it wants. π-jcommand β perform a LuaJIT2 control command (and yes, an optional space after-jis fine). π-O[opt] β control LuaJIT2 optimizations. tune it, bestie. π₯-iβ run in interactive mode. the REPL era begins. β¨-vβ show LuaJIT2 version. say hi. π-Eβ ignore environment variables. bye felicia π«Ά--β stop processing options. everything after is not an option, periodt. π-β read script from stdin instead. πΈ
after all options are processed, the given script is run. the arguments are passed in the global arg table β that's where they live, iykyk. π
interactive mode is only entered if no script and no -e option is given. and you can leave interactive mode with EOF (Ctrl+Z). π
π EXAMPLES
luajit2 hello.lua world
prints "Hello world", assuming hello.lua contains:
print("Hello", arg[1])
luajit2 -e "local x=0; for i=1,1e9 do x=x+i end; print(x)"
calculates the sum of the numbers from 1 to 1000000000. and finishes in a reasonable amount of time, too. like?? a billion iterations?? main character energy tbh. π₯π
luajit2 -jv -e "for i=1,10 do for j=1,10 do for k=1,100 do end end end"
runs some nested loops and shows the resulting traces. vibe check: passed. π¦
π COPYRIGHT
LuaJIT2 is Copyright Β© 2005-2025 Mike Pall.
LuaJIT2 is open source software, released under the MIT license. ate and left no crumbs. π
πΈ SEE ALSO
more details in the provided HTML docs or at: https://github.com/openresty/luajit2
more about the Lua language can be found at: https://lua.org/docs.html β¨
lua(1) β the classic. the blueprint. π
okay that's the whole page bestie!! you're officially a luajit2(1) girlie now π«Ά β this was the luajit2(1) page from the LuaJIT2 documentation, brought to you with love, bytecode, and absolutely zero chill. mwah π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: luajit2 2.1.20250529-bp160.1.3 Β· MIT
- opensuse-leap 16.0: luajit2 2.1.20250529-bp160.1.3 Β· MIT
- opensuse-leap 16.0: luajit2 2.1.20250529-bp160.1.3 Β· MIT
- opensuse-leap 16.0: luajit2 2.1.20250529-bp160.1.3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms