luajit(1)
π luajit(1) β the LuaJIT page, but make it make sense
okay so bestie, welcome to the luajit(1) page from the LuaJIT documentation β¨ this is the whole thing, every flag, every example, no skips, no cap π«Ά
π SYNOPSIS
luajit [options]... [script [args]...]
literally that's it. options, then maybe a script, then maybe args for that script. slay π
π WEB SITE
https://luajit.org β go off, icon π
β¨ DESCRIPTION
okay so this is the command-line program you use to run Lua programs with LuaJIT π
LuaJIT is a just-in-time (JIT) compiler for the Lua language. The virtual machine (VM) is based on a fast interpreter combined with a trace compiler. It can significantly improve the performance of Lua programs π₯ like, your Lua goes zoom.
and here's the iconic part: 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 it in. periodt.
π OPTIONS
one bullet per flag, all of them, in order, bestie π«Ά
-echunk β run the given chunk of Lua code. like, right there on the command line, no file needed β¨-llibrary β load the named library, just likerequire("library"). same vibe, command-line edition π-b ...β save or list bytecode. run it with no arguments and it gives you help on the options π-jcommand β perform a LuaJIT control command (there's an optional space after-j, so-jvand-j vboth work, iykyk).-O[opt]β control LuaJIT optimizations πΈ the[opt]is optional, so it's snug right up against the-O.-iβ run in interactive mode π-vβ show the LuaJIT version. quick flex.-Eβ ignore environment variables π--β stop processing options. everything after this is not an option, no matter how option-y it looks.-β read the script from stdin instead π¦ (yes, a single lonely dash)
aaaand after all options are processed, the given script is run. the arguments are passed in the global arg table β¨
π important lil note: interactive mode is only entered if no script and no -e option is given. and once you're in, you can leave interactive mode with EOF (Ctrl+Z).
π₯ EXAMPLES
π example one
luajit hello.lua world
Prints "Hello world", assuming hello.lua contains:
print("Hello", arg[1])
see how world lands in arg[1]? that's the global arg table doing its thing π
β example two
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. and finishes in a reasonable amount of time, too π like, a billion iterations. the JIT is carrying this whole thing on its back and it's not even breaking a sweat.
π§ example three
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 π -jv = control command, verbose traces. main character energy fr fr.
π COPYRIGHT
LuaJIT is Copyright Β© 2005-2023 Mike Pall. LuaJIT is open source software, released under the MIT license. π
π¦ 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 lua(1)β yeah, that one. the classic.
and that's the page bestie!! π
this was luajit(1) from the LuaJIT documentation β footer says luajit(1) and nothing else, no date, no version number, so that's all you're getting from me on that front π mwah, go compile something iconic πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: luajit 5.1.2.1.0+git.1731601260.fe71d0f-160000.2.2 Β· MIT
- opensuse-leap 16.0: luajit 5.1.2.1.0+git.1731601260.fe71d0f-160000.2.2 Β· MIT
- opensuse-leap 16.0: luajit 5.1.2.1.0+git.1731601260.fe71d0f-160000.2.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms