luajit.1 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. .TH luajit 1 "" "" "LuaJIT documentation"
  2. .SH NAME
  3. luajit \- Just-In-Time Compiler for the Lua Language
  4. \fB
  5. .SH SYNOPSIS
  6. .B luajit
  7. [\fIoptions\fR]... [\fIscript\fR [\fIargs\fR]...]
  8. .SH "WEB SITE"
  9. .IR http://luajit.org
  10. .SH DESCRIPTION
  11. .PP
  12. This is the command-line program to run Lua programs with \fBLuaJIT\fR.
  13. .PP
  14. \fBLuaJIT\fR is a just-in-time (JIT) compiler for the Lua language.
  15. The virtual machine (VM) is based on a fast interpreter combined with
  16. a trace compiler. It can significantly improve the performance of Lua programs.
  17. .PP
  18. \fBLuaJIT\fR is API\- and ABI-compatible with the VM of the standard
  19. Lua\ 5.1 interpreter. When embedding the VM into an application,
  20. the built library can be used as a drop-in replacement.
  21. .SH OPTIONS
  22. .TP
  23. .BI "\-e " chunk
  24. Run the given chunk of Lua code.
  25. .TP
  26. .BI "\-l " library
  27. Load the named library, just like \fBrequire("\fR\fIlibrary\fR\fB")\fR.
  28. .TP
  29. .BI "\-j " command
  30. Perform LuaJIT control command (optional space after \fB\-j\fR).
  31. .TP
  32. .BI "\-O" [opt]
  33. Control LuaJIT optimizations.
  34. .TP
  35. .B "\-i"
  36. Run in interactive mode.
  37. .TP
  38. .B "\-v"
  39. Show \fBLuaJIT\fR version.
  40. .TP
  41. .B "\-\-"
  42. Stop processing options.
  43. .TP
  44. .B "\-"
  45. Read script from stdin instead.
  46. .PP
  47. After all options are processed, the given \fIscript\fR is run.
  48. The arguments are passed in the global \fIarg\fR table.
  49. .PP
  50. Interactive mode is only entered, if no \fIscript\fR and no \fB\-e\fR
  51. option is given. Interactive mode can be left with EOF (\fICtrl\-Z\fB).
  52. .SH EXAMPLES
  53. .TP
  54. luajit hello.lua world
  55. Prints "Hello world", assuming \fIhello.lua\fR contains:
  56. .br
  57. print("Hello", arg[1])
  58. .TP
  59. luajit \-e "local x=0; for i=1,1e9 do x=x+i end; print(x)"
  60. Calculates the sum of the numbers from 1 to 1000000000.
  61. .br
  62. And finishes in a reasonable amount of time, too.
  63. .TP
  64. luajit \-jv \-e "for i=1,10 do for j=1,10 do for k=1,100 do end end end"
  65. Runs some nested loops and shows the resulting traces.
  66. .SH COPYRIGHT
  67. .PP
  68. \fBLuaJIT\fR is Copyright \(co 2005-2010 Mike Pall.
  69. .br
  70. \fBLuaJIT\fR is open source software, released under the MIT/X license.
  71. .SH SEE ALSO
  72. .PP
  73. More details in the provided HTML docs or at:
  74. .IR http://luajit.org
  75. .br
  76. More about the Lua language can be found at:
  77. .IR http://lua.org/docs.html
  78. .PP
  79. lua(1)