faq.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <title>Frequently Asked Questions (FAQ)</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  6. <meta name="Author" content="Mike Pall">
  7. <meta name="Copyright" content="Copyright (C) 2005-2009, Mike Pall">
  8. <meta name="Language" content="en">
  9. <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
  10. <link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
  11. <style type="text/css">
  12. dd { margin-left: 1.5em; }
  13. </style>
  14. </head>
  15. <body>
  16. <div id="site">
  17. <a href="http://luajit.org"><span>Lua<span id="logo">JIT</span></span></a>
  18. </div>
  19. <div id="head">
  20. <h1>Frequently Asked Questions (FAQ)</h1>
  21. </div>
  22. <div id="nav">
  23. <ul><li>
  24. <a href="luajit.html">LuaJIT</a>
  25. <ul><li>
  26. <a href="install.html">Installation</a>
  27. </li><li>
  28. <a href="running.html">Running</a>
  29. </li><li>
  30. <a href="api.html">API Extensions</a>
  31. </li></ul>
  32. </li><li>
  33. <a href="status.html">Status</a>
  34. <ul><li>
  35. <a href="changes.html">Changes</a>
  36. </li></ul>
  37. </li><li>
  38. <a class="current" href="faq.html">FAQ</a>
  39. </li><li>
  40. <a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
  41. </li></ul>
  42. </div>
  43. <div id="main">
  44. <dl>
  45. <dt>Q: Where can I learn more about Lua and LuaJIT?</dt>
  46. <dd>
  47. <ul style="padding: 0;">
  48. <li>The <a href="http://lua.org"><span class="ext">&raquo;</span>&nbsp;main Lua.org site</a> has complete
  49. <a href="http://www.lua.org/docs.html"><span class="ext">&raquo;</span>&nbsp;documentation</a> of the language
  50. and links to books and papers about Lua.</li>
  51. <li>The community-managed <a href="http://lua-users.org/wiki/"><span class="ext">&raquo;</span>&nbsp;Lua Wiki</a>
  52. has information about diverse topics.</li>
  53. <li>The primary source of information for the latest developments surrounding
  54. Lua is the <a href="http://www.lua.org/lua-l.html"><span class="ext">&raquo;</span>&nbsp;Lua mailing list</a>.
  55. You can check out the <a href="http://lua-users.org/lists/lua-l/"><span class="ext">&raquo;</span>&nbsp;mailing
  56. list archive</a> or
  57. <a href="http://bazar2.conectiva.com.br/mailman/listinfo/lua"><span class="ext">&raquo;</span>&nbsp;subscribe</a>
  58. to the list (you need to be subscribed before posting).<br>
  59. This is also the place where announcements and discussions about LuaJIT
  60. take place.</li>
  61. </ul>
  62. </dl>
  63. <dl>
  64. <dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt>
  65. <dd>
  66. I'm planning to write more documentation about the internals of LuaJIT.
  67. In the meantime, please use the following Google Scholar searches
  68. to find relevant papers:<br>
  69. Search for: <a href="http://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">&raquo;</span>&nbsp;Trace Compiler</a><br>
  70. Search for: <a href="http://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">&raquo;</span>&nbsp;JIT Compiler</a><br>
  71. Search for: <a href="http://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">&raquo;</span>&nbsp;Dynamic Language Optimizations</a><br>
  72. Search for: <a href="http://scholar.google.com/scholar?q=SSA+Form"><span class="ext">&raquo;</span>&nbsp;SSA Form</a><br>
  73. Search for: <a href="http://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">&raquo;</span>&nbsp;Linear Scan Register Allocation</a><br>
  74. And, you know, reading the source is of course the only way to enlightenment. :-)
  75. </dd>
  76. </dl>
  77. <dl>
  78. <dt>Q: Why do I get this error: "attempt to index global 'arg' (a nil value)"?<br>
  79. Q: My vararg functions fail after switching to LuaJIT!</dt>
  80. <dd>LuaJIT is compatible to the Lua 5.1 language standard. It doesn't
  81. support the implicit <tt>arg</tt> parameter for old-style vararg
  82. functions from Lua 5.0.<br>Please convert your code to the
  83. <a href="http://www.lua.org/manual/5.1/manual.html#2.5.9"><span class="ext">&raquo;</span>&nbsp;Lua 5.1
  84. vararg syntax</a>.</dd>
  85. </dl>
  86. <dl>
  87. <dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt>
  88. <dd>The interrupt signal handler sets a Lua debug hook. But this is
  89. currently ignored by compiled code (this will eventually be fixed). If
  90. your program is running in a tight loop and never falls back to the
  91. interpreter, the debug hook never runs and can't throw the
  92. "interrupted!" error.<br> In the meantime you have to press Ctrl-C
  93. twice to get stop your program. That's similar to when it's stuck
  94. running inside a C function under the Lua interpreter.</dd>
  95. </dl>
  96. <dl>
  97. <dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt>
  98. <dd>Because it's a completely redesigned VM and has very little code
  99. in common with Lua anymore. Also, if the patch introduces changes to
  100. the Lua semantics, this would need to be reflected everywhere in the
  101. VM, from the interpreter up to all stages of the compiler.<br> Please
  102. use only standard Lua language constructs. For many common needs you
  103. can use source transformations or use wrapper or proxy functions.
  104. The compiler will happily optimize away such indirections.</dd>
  105. </dl>
  106. <dl>
  107. <dt>Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?</dt>
  108. <dd>Because it's a compiler &mdash; it needs to generate native
  109. machine code. This means the code generator must be ported to each
  110. architecture. And the fast interpreter is written in assembler and
  111. must be ported, too. This is quite an undertaking.<br> Currently only
  112. x86 CPUs are supported. x64 support is in the works. Other
  113. architectures will follow with sufficient demand and/or
  114. sponsoring.</dd>
  115. </dl>
  116. <dl>
  117. <dt>Q: When will feature X be added? When will the next version be released?</dt>
  118. <dd>When it's ready.<br>
  119. C'mon, it's open source &mdash; I'm doing it on my own time and you're
  120. getting it for free. You can either contribute a patch or sponsor
  121. the development of certain features, if they are important to you.
  122. </dd>
  123. </dl>
  124. <br class="flush">
  125. </div>
  126. <div id="foot">
  127. <hr class="hide">
  128. Copyright &copy; 2005-2009 Mike Pall
  129. <span class="noprint">
  130. &middot;
  131. <a href="contact.html">Contact</a>
  132. </span>
  133. </div>
  134. </body>
  135. </html>