diff options
author | Mike Pall <mike> | 2023-08-21 02:28:49 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2023-08-21 02:28:49 +0200 |
commit | c34594681909cac98d44629863df2c7afd93eaf0 (patch) | |
tree | 494edfb290b2354cd738e07751c58d65d6b1c1c2 /doc/faq.html | |
parent | 158a284cc9c33ade9054df976018401e4996cfbd (diff) | |
download | luajit-c34594681909cac98d44629863df2c7afd93eaf0.tar.gz luajit-c34594681909cac98d44629863df2c7afd93eaf0.tar.bz2 luajit-c34594681909cac98d44629863df2c7afd93eaf0.zip |
Update documentation for switch to rolling releases.
Diffstat (limited to 'doc/faq.html')
-rw-r--r-- | doc/faq.html | 191 |
1 files changed, 0 insertions, 191 deletions
diff --git a/doc/faq.html b/doc/faq.html deleted file mode 100644 index f160fffe..00000000 --- a/doc/faq.html +++ /dev/null | |||
@@ -1,191 +0,0 @@ | |||
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="Copyright" content="Copyright (C) 2005-2023"> | ||
7 | <meta name="Language" content="en"> | ||
8 | <link rel="stylesheet" type="text/css" href="bluequad.css" media="screen"> | ||
9 | <link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print"> | ||
10 | <style type="text/css"> | ||
11 | dd { margin-left: 1.5em; } | ||
12 | </style> | ||
13 | </head> | ||
14 | <body> | ||
15 | <div id="site"> | ||
16 | <a href="https://luajit.org"><span>Lua<span id="logo">JIT</span></span></a> | ||
17 | </div> | ||
18 | <div id="head"> | ||
19 | <h1>Frequently Asked Questions (FAQ)</h1> | ||
20 | </div> | ||
21 | <div id="nav"> | ||
22 | <ul><li> | ||
23 | <a href="luajit.html">LuaJIT</a> | ||
24 | <ul><li> | ||
25 | <a href="https://luajit.org/download.html">Download <span class="ext">»</span></a> | ||
26 | </li><li> | ||
27 | <a href="install.html">Installation</a> | ||
28 | </li><li> | ||
29 | <a href="running.html">Running</a> | ||
30 | </li></ul> | ||
31 | </li><li> | ||
32 | <a href="extensions.html">Extensions</a> | ||
33 | <ul><li> | ||
34 | <a href="ext_ffi.html">FFI Library</a> | ||
35 | <ul><li> | ||
36 | <a href="ext_ffi_tutorial.html">FFI Tutorial</a> | ||
37 | </li><li> | ||
38 | <a href="ext_ffi_api.html">ffi.* API</a> | ||
39 | </li><li> | ||
40 | <a href="ext_ffi_semantics.html">FFI Semantics</a> | ||
41 | </li></ul> | ||
42 | </li><li> | ||
43 | <a href="ext_jit.html">jit.* Library</a> | ||
44 | </li><li> | ||
45 | <a href="ext_c_api.html">Lua/C API</a> | ||
46 | </li></ul> | ||
47 | </li><li> | ||
48 | <a href="status.html">Status</a> | ||
49 | </li><li> | ||
50 | <a class="current" href="faq.html">FAQ</a> | ||
51 | </li><li> | ||
52 | <a href="https://luajit.org/list.html">Mailing List <span class="ext">»</span></a> | ||
53 | </li></ul> | ||
54 | </div> | ||
55 | <div id="main"> | ||
56 | <dl id="info"> | ||
57 | <dt>Q: Where can I learn more about LuaJIT and Lua?</dt> | ||
58 | <dd> | ||
59 | <ul style="padding: 0;"> | ||
60 | <li>The <a href="https://luajit.org/list.html"><span class="ext">»</span> LuaJIT mailing list</a> focuses on topics | ||
61 | related to LuaJIT.</li> | ||
62 | <li>News about Lua itself can be found at the | ||
63 | <a href="https://www.lua.org/lua-l.html"><span class="ext">»</span> Lua mailing list</a>. | ||
64 | The mailing list archives are worth checking out for older postings | ||
65 | about LuaJIT.</li> | ||
66 | <li>The <a href="https://lua.org"><span class="ext">»</span> main Lua.org site</a> has complete | ||
67 | <a href="https://www.lua.org/docs.html"><span class="ext">»</span> documentation</a> of the language | ||
68 | and links to books and papers about Lua.</li> | ||
69 | <li>The community-managed <a href="http://lua-users.org/wiki/"><span class="ext">»</span> Lua Wiki</a> | ||
70 | has information about diverse topics.</li> | ||
71 | </ul></dd> | ||
72 | </dl> | ||
73 | |||
74 | <dl id="tech"> | ||
75 | <dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt> | ||
76 | <dd> | ||
77 | Please use the following Google Scholar searches to find relevant papers:<br> | ||
78 | Search for: <a href="https://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">»</span> Trace Compiler</a><br> | ||
79 | Search for: <a href="https://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">»</span> JIT Compiler</a><br> | ||
80 | Search for: <a href="https://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">»</span> Dynamic Language Optimizations</a><br> | ||
81 | Search for: <a href="https://scholar.google.com/scholar?q=SSA+Form"><span class="ext">»</span> SSA Form</a><br> | ||
82 | Search for: <a href="https://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">»</span> Linear Scan Register Allocation</a><br> | ||
83 | Here is a list of the <a href="http://lua-users.org/lists/lua-l/2009-11/msg00089.html"><span class="ext">»</span> innovative features in LuaJIT</a>.<br> | ||
84 | And, you know, reading the source is of course the only way to enlightenment. | ||
85 | </dd> | ||
86 | </dl> | ||
87 | |||
88 | <dl id="arg"> | ||
89 | <dt>Q: Why do I get this error: "attempt to index global 'arg' (a nil value)"?<br> | ||
90 | Q: My vararg functions fail after switching to LuaJIT!</dt> | ||
91 | <dd>LuaJIT is compatible to the Lua 5.1 language standard. It doesn't | ||
92 | support the implicit <tt>arg</tt> parameter for old-style vararg | ||
93 | functions from Lua 5.0.<br>Please convert your code to the | ||
94 | <a href="https://www.lua.org/manual/5.1/manual.html#2.5.9"><span class="ext">»</span> Lua 5.1 | ||
95 | vararg syntax</a>.</dd> | ||
96 | </dl> | ||
97 | |||
98 | <dl id="x87"> | ||
99 | <dt>Q: Why do I get this error: "bad FPU precision"?<br> | ||
100 | <dt>Q: I get weird behavior after initializing Direct3D.<br> | ||
101 | <dt>Q: Some FPU operations crash after I load a Delphi DLL.<br> | ||
102 | </dt> | ||
103 | <dd> | ||
104 | |||
105 | DirectX/Direct3D (up to version 9) sets the x87 FPU to single-precision | ||
106 | mode by default. This violates the Windows ABI and interferes with the | ||
107 | operation of many programs — LuaJIT is affected, too. Please make | ||
108 | sure you always use the <tt>D3DCREATE_FPU_PRESERVE</tt> flag when | ||
109 | initializing Direct3D.<br> | ||
110 | |||
111 | Direct3D version 10 or higher do not show this behavior anymore. | ||
112 | Consider testing your application with older versions, too.<br> | ||
113 | |||
114 | Similarly, the Borland/Delphi runtime modifies the FPU control word and | ||
115 | enables FP exceptions. Of course, this violates the Windows ABI, too. | ||
116 | Please check the Delphi docs for the Set8087CW method.</dd> | ||
117 | </dl> | ||
118 | |||
119 | <dl id="ctrlc"> | ||
120 | <dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt> | ||
121 | <dd>The interrupt signal handler sets a Lua debug hook. But this is | ||
122 | ignored by compiled code. If your program is running in a tight loop | ||
123 | and never falls back to the interpreter, the debug hook never runs and | ||
124 | can't throw the "interrupted!" error.<br> | ||
125 | You have to press Ctrl-C twice to stop your program. That's similar | ||
126 | to when it's stuck running inside a C function under the Lua interpreter.</dd> | ||
127 | </dl> | ||
128 | |||
129 | <dl id="order"> | ||
130 | <dt>Q: Table iteration with <tt>pairs()</tt> does not result in the same order?</dt> | ||
131 | <dd>The order of table iteration is explicitly <b>undefined</b> by | ||
132 | the Lua language standard.<br> | ||
133 | Different Lua implementations or versions may use different orders for | ||
134 | otherwise identical tables. Different ways of constructing a table may | ||
135 | result in different orders, too.<br> | ||
136 | Due to improved VM security, LuaJIT 2.1 may even use a different order | ||
137 | on separate VM invocations or when string keys are newly interned.<br><br> | ||
138 | If your program relies on a deterministic order, it has a bug. Rewrite it, | ||
139 | so it doesn't rely on the key order. Or sort the table keys, if you must.</dd> | ||
140 | </dl> | ||
141 | |||
142 | <dl id="sandbox"> | ||
143 | <dt>Q: Can Lua code be safely sandboxed?</dt> | ||
144 | <dd> | ||
145 | Maybe for an extremely restricted subset of Lua and if you relentlessly | ||
146 | scrutinize every single interface function you offer to the untrusted code.<br> | ||
147 | |||
148 | Although Lua provides some sandboxing functionality (<tt>setfenv()</tt>, hooks), | ||
149 | it's very hard to get this right even for the Lua core libraries. Of course, | ||
150 | you'll need to inspect any extension library, too. And there are libraries | ||
151 | that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br> | ||
152 | |||
153 | More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">»</span> Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)"><span class="ext">»</span> Wikipedia</a>.<br><br> | ||
154 | |||
155 | Relatedly, <b>loading untrusted bytecode is not safe!</b><br> | ||
156 | |||
157 | It's trivial to crash the Lua or LuaJIT VM with maliciously crafted bytecode. | ||
158 | This is well known and there's no bytecode verification on purpose, so please | ||
159 | don't report a bug about it. Check the <tt>mode</tt> parameter for the | ||
160 | <tt>load*()</tt> functions to disable loading of bytecode.<br><br> | ||
161 | |||
162 | <b>In general, the only promising approach is to sandbox Lua code at the | ||
163 | process level and not the VM level.</b> | ||
164 | </dd> | ||
165 | </dl> | ||
166 | |||
167 | <dl id="arch"> | ||
168 | <dt>Q: Lua runs everywhere. Why doesn't LuaJIT support my CPU?</dt> | ||
169 | <dd>Because it's a compiler — it needs to generate native | ||
170 | machine code. This means the code generator must be ported to each | ||
171 | architecture. And the fast interpreter is written in assembler and | ||
172 | must be ported, too. This is quite an undertaking.<br> | ||
173 | The <a href="install.html">install documentation</a> shows the supported | ||
174 | architectures.<br> | ||
175 | Other architectures may follow based on sufficient user demand and | ||
176 | market-relevance of the architecture. Sponsoring is required to develop | ||
177 | the port itself, to integrate it and to continuously maintain it in the | ||
178 | actively developed branches.</dd> | ||
179 | </dl> | ||
180 | <br class="flush"> | ||
181 | </div> | ||
182 | <div id="foot"> | ||
183 | <hr class="hide"> | ||
184 | Copyright © 2005-2023 | ||
185 | <span class="noprint"> | ||
186 | · | ||
187 | <a href="contact.html">Contact</a> | ||
188 | </span> | ||
189 | </div> | ||
190 | </body> | ||
191 | </html> | ||