luajit(1)
β¨ luajit β the manual page, but make it cute β¨
okay bestie, sit down, hydrate, and let me tell you about luajit(1) π
this is the manual page for LuaJIT, straight from the LuaJIT documentation, and by the end of this you're gonna be running circles around everyone. no cap.
πΈ NAME πΈ
luajit β the Just-In-Time Compiler for the Lua Language. yes, that's its whole government name. it compiles. it's just in time. it's iconic. π
π¦ SYNOPSIS π¦
luajit [options]... [script [args]...]
that's the whole vibe. options first, then optionally a script, then optionally that script's args. that's it. that's the shape of it. β¨
π WEB SITE π
go there. bookmark it. tell your friends. it's giving resource. π«Ά
π DESCRIPTION π
so this is the command-line program you use to run Lua programs with LuaJIT. that's the whole job description.
LuaJIT is a just-in-time (JIT) compiler for the Lua language. the virtual machine (VM) is built on a fast interpreter combined with a trace compiler, and the way that combo just significantly improves the performance of Lua programs?? obsessed. π₯
and here's the part that makes it lowkey a big deal: LuaJIT 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. no rewrites, no drama, just swap and slay. π
π OPTIONS π
one bullet per flag, bestie, we do not skip. every single one is here.
-e chunkβ run the given chunk of Lua code. instant script, no file needed. β‘-l libraryβ load the named library, literally exactly likerequire("library"). same energy, different spelling. π-b ...β save or list bytecode. run it with no arguments and it'll hand you help on the options. it's helpful like that. π-j commandβ perform a LuaJIT control command. (psst: an optional space after-jis allowed, so-j commandand-jcommandboth work.) π-O[opt]β control LuaJIT optimizations. theoptpart is optional, hence the brackets. π§-iβ run in interactive mode. chat with your interpreter. π¬-vβ show the LuaJIT version. vibe check the build. β-Eβ ignore environment variables. boundaries. set them. π«--β stop processing options. everything after this is not a flag, periodt. β-β read the script fromstdininstead. pipe it in, live your life. π
okay so here's what happens next, and it matters: after all options are processed, the given script is run, and the arguments are passed in the global arg table. πΈ
and interactive mode? it's only entered if there's no script and no -e option given. that's the only door in. πͺ
interactive mode can be left with EOF (Ctrl-Z). that's your exit, bestie. don't get trapped in there. π
β¨ EXAMPLES β¨
okay now the fun part, let's actually do stuff. π
1.
luajit hello.lua world
prints "Hello world", assuming hello.lua contains:
print("Hello", arg[1])
look at arg[1] doing its little job. we love a global table moment. π
2.
luajit -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. a billion iterations. and it finishes in a reasonable amount of time, too. π that's the JIT working its magic, no cap. π₯
3.
luajit -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. trace compiler said let me cook. π
π COPYRIGHT π
LuaJIT is Copyright Β© 2005-2026 Mike Pall.
LuaJIT is open source software, released under the MIT license. free, open, generous. we stan. π
π SEE ALSO π
- more details in the provided HTML docs, or at: https://luajit.org
- more about the Lua language can be found at: https://lua.org/docs.html
and also:
and that's the whole page, bestie. this was luajit(1) from the LuaJIT documentation β and since this page has no date stamped on it, just take my word for it: it's current, it's cute, and it's yours. π go compile something. mwah. π
β¨
π¦ where this page comes from
- arch rolling: luajit 2.1.1793383622+ea9eb7e-1 Β· MIT
- fedora 43: luajit 2.1.1767980792-1.fc43 Β· MIT
- fedora 43: luajit 2.1.1767980792-1.fc43 Β· MIT
- fedora 44: luajit 2.1.1767980792-1.fc44 Β· MIT
- fedora 44: luajit 2.1.1767980792-1.fc44 Β· MIT
- nixos 26.05: luajit 2.1.1774638290
- nixos 26.05: openresty 1.31.1.1
- nixpkgs unstable: luajit 2.1.1785763465
- nixpkgs unstable: openresty 1.31.1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms