1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
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-2017, 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; }
17 <a href=
"http://luajit.org"><span>Lua
<span id=
"logo">JIT
</span></span></a>
20 <h1>Frequently Asked Questions (FAQ)
</h1>
24 <a href=
"luajit.html">LuaJIT
</a>
26 <a href=
"http://luajit.org/download.html">Download
<span class=
"ext">»</span></a>
28 <a href=
"install.html">Installation
</a>
30 <a href=
"running.html">Running
</a>
33 <a href=
"extensions.html">Extensions
</a>
35 <a href=
"ext_ffi.html">FFI Library
</a>
37 <a href=
"ext_ffi_tutorial.html">FFI Tutorial
</a>
39 <a href=
"ext_ffi_api.html">ffi.* API
</a>
41 <a href=
"ext_ffi_semantics.html">FFI Semantics
</a>
44 <a href=
"ext_jit.html">jit.* Library
</a>
46 <a href=
"ext_c_api.html">Lua/C API
</a>
49 <a href=
"status.html">Status
</a>
51 <a href=
"changes.html">Changes
</a>
54 <a class=
"current" href=
"faq.html">FAQ
</a>
56 <a href=
"http://luajit.org/performance.html">Performance
<span class=
"ext">»</span></a>
58 <a href=
"http://wiki.luajit.org/">Wiki
<span class=
"ext">»</span></a>
60 <a href=
"http://luajit.org/list.html">Mailing List
<span class=
"ext">»</span></a>
65 <dt>Q: Where can I learn more about LuaJIT and Lua?
</dt>
67 <ul style=
"padding: 0;">
68 <li>The
<a href=
"http://luajit.org/list.html"><span class=
"ext">»</span> LuaJIT mailing list
</a> focuses on topics
69 related to LuaJIT.
</li>
70 <li>The
<a href=
"http://wiki.luajit.org/"><span class=
"ext">»</span> LuaJIT wiki
</a> gathers community
71 resources about LuaJIT.
</li>
72 <li>News about Lua itself can be found at the
73 <a href=
"http://www.lua.org/lua-l.html"><span class=
"ext">»</span> Lua mailing list
</a>.
74 The mailing list archives are worth checking out for older postings
76 <li>The
<a href=
"http://lua.org"><span class=
"ext">»</span> main Lua.org site
</a> has complete
77 <a href=
"http://www.lua.org/docs.html"><span class=
"ext">»</span> documentation
</a> of the language
78 and links to books and papers about Lua.
</li>
79 <li>The community-managed
<a href=
"http://lua-users.org/wiki/"><span class=
"ext">»</span> Lua Wiki
</a>
80 has information about diverse topics.
</li>
85 <dt>Q: Where can I learn more about the compiler technology used by LuaJIT?
</dt>
87 I'm planning to write more documentation about the internals of LuaJIT.
88 In the meantime, please use the following Google Scholar searches
89 to find relevant papers:
<br>
90 Search for:
<a href=
"http://scholar.google.com/scholar?q=Trace+Compiler"><span class=
"ext">»</span> Trace Compiler
</a><br>
91 Search for:
<a href=
"http://scholar.google.com/scholar?q=JIT+Compiler"><span class=
"ext">»</span> JIT Compiler
</a><br>
92 Search for:
<a href=
"http://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class=
"ext">»</span> Dynamic Language Optimizations
</a><br>
93 Search for:
<a href=
"http://scholar.google.com/scholar?q=SSA+Form"><span class=
"ext">»</span> SSA Form
</a><br>
94 Search for:
<a href=
"http://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class=
"ext">»</span> Linear Scan Register Allocation
</a><br>
95 Here is a list of the
<a href=
"http://article.gmane.org/gmane.comp.lang.lua.general/58908"><span class=
"ext">»</span> innovative features in LuaJIT
</a>.
<br>
96 And, you know, reading the source is of course the only way to enlightenment. :-)
101 <dt>Q: Why do I get this error:
"attempt to index global 'arg' (a nil value)"?
<br>
102 Q: My vararg functions fail after switching to LuaJIT!
</dt>
103 <dd>LuaJIT is compatible to the Lua
5.1 language standard. It doesn't
104 support the implicit
<tt>arg
</tt> parameter for old-style vararg
105 functions from Lua
5.0.
<br>Please convert your code to the
106 <a href=
"http://www.lua.org/manual/5.1/manual.html#2.5.9"><span class=
"ext">»</span> Lua
5.1
107 vararg syntax
</a>.
</dd>
111 <dt>Q: Why do I get this error:
"bad FPU precision"?
<br>
112 <dt>Q: I get weird behavior after initializing Direct3D.
<br>
113 <dt>Q: Some FPU operations crash after I load a Delphi DLL.
<br>
117 DirectX/Direct3D (up to version
9) sets the x87 FPU to single-precision
118 mode by default. This violates the Windows ABI and interferes with the
119 operation of many programs
— LuaJIT is affected, too. Please make
120 sure you always use the
<tt>D3DCREATE_FPU_PRESERVE
</tt> flag when
121 initializing Direct3D.
<br>
123 Direct3D version
10 or higher do not show this behavior anymore.
124 Consider testing your application with older versions, too.
<br>
126 Similarly, the Borland/Delphi runtime modifies the FPU control word and
127 enables FP exceptions. Of course this violates the Windows ABI, too.
128 Please check the Delphi docs for the Set8087CW method.
133 <dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?
</dt>
134 <dd>The interrupt signal handler sets a Lua debug hook. But this is
135 currently ignored by compiled code (this will eventually be fixed). If
136 your program is running in a tight loop and never falls back to the
137 interpreter, the debug hook never runs and can't throw the
138 "interrupted!" error.
<br> In the meantime you have to press Ctrl-C
139 twice to get stop your program. That's similar to when it's stuck
140 running inside a C function under the Lua interpreter.
</dd>
144 <dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?
</dt>
145 <dd>Because it's a completely redesigned VM and has very little code
146 in common with Lua anymore. Also, if the patch introduces changes to
147 the Lua semantics, these would need to be reflected everywhere in the
148 VM, from the interpreter up to all stages of the compiler.
<br> Please
149 use only standard Lua language constructs. For many common needs you
150 can use source transformations or use wrapper or proxy functions.
151 The compiler will happily optimize away such indirections.
</dd>
155 <dt>Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?
</dt>
156 <dd>Because it's a compiler
— it needs to generate native
157 machine code. This means the code generator must be ported to each
158 architecture. And the fast interpreter is written in assembler and
159 must be ported, too. This is quite an undertaking.
<br>
160 The
<a href=
"install.html">install documentation
</a> shows the supported
161 architectures. Other architectures will follow based on sufficient user
162 demand and/or sponsoring.
</dd>
166 <dt>Q: When will feature X be added? When will the next version be released?
</dt>
167 <dd>When it's ready.
<br>
168 C'mon, it's open source
— I'm doing it on my own time and you're
169 getting it for free. You can either contribute a patch or sponsor
170 the development of certain features, if they are important to you.
177 Copyright
© 2005-
2017 Mike Pall
178 <span class=
"noprint">
180 <a href=
"contact.html">Contact
</a>