aboutsummaryrefslogtreecommitdiff
path: root/doc/faq.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/faq.html')
-rw-r--r--doc/faq.html61
1 files changed, 21 insertions, 40 deletions
diff --git a/doc/faq.html b/doc/faq.html
index a7144670..843480fc 100644
--- a/doc/faq.html
+++ b/doc/faq.html
@@ -78,16 +78,14 @@ has information about diverse topics.</li>
78<dl id="tech"> 78<dl id="tech">
79<dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt> 79<dt>Q: Where can I learn more about the compiler technology used by LuaJIT?</dt>
80<dd> 80<dd>
81I'm planning to write more documentation about the internals of LuaJIT. 81Please use the following Google Scholar searches to find relevant papers:<br>
82In the meantime, please use the following Google Scholar searches
83to find relevant papers:<br>
84Search for: <a href="https://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">&raquo;</span>&nbsp;Trace Compiler</a><br> 82Search for: <a href="https://scholar.google.com/scholar?q=Trace+Compiler"><span class="ext">&raquo;</span>&nbsp;Trace Compiler</a><br>
85Search for: <a href="https://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">&raquo;</span>&nbsp;JIT Compiler</a><br> 83Search for: <a href="https://scholar.google.com/scholar?q=JIT+Compiler"><span class="ext">&raquo;</span>&nbsp;JIT Compiler</a><br>
86Search for: <a href="https://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">&raquo;</span>&nbsp;Dynamic Language Optimizations</a><br> 84Search for: <a href="https://scholar.google.com/scholar?q=Dynamic+Language+Optimizations"><span class="ext">&raquo;</span>&nbsp;Dynamic Language Optimizations</a><br>
87Search for: <a href="https://scholar.google.com/scholar?q=SSA+Form"><span class="ext">&raquo;</span>&nbsp;SSA Form</a><br> 85Search for: <a href="https://scholar.google.com/scholar?q=SSA+Form"><span class="ext">&raquo;</span>&nbsp;SSA Form</a><br>
88Search for: <a href="https://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">&raquo;</span>&nbsp;Linear Scan Register Allocation</a><br> 86Search for: <a href="https://scholar.google.com/scholar?q=Linear+Scan+Register+Allocation"><span class="ext">&raquo;</span>&nbsp;Linear Scan Register Allocation</a><br>
89Here is a list of the <a href="http://lua-users.org/lists/lua-l/2009-11/msg00089.html"><span class="ext">&raquo;</span>&nbsp;innovative features in LuaJIT</a>.<br> 87Here is a list of the <a href="http://lua-users.org/lists/lua-l/2009-11/msg00089.html"><span class="ext">&raquo;</span>&nbsp;innovative features in LuaJIT</a>.<br>
90And, you know, reading the source is of course the only way to enlightenment. :-) 88And, you know, reading the source is of course the only way to enlightenment.
91</dd> 89</dd>
92</dl> 90</dl>
93 91
@@ -126,12 +124,11 @@ Please check the Delphi docs for the Set8087CW method.
126<dl id="ctrlc"> 124<dl id="ctrlc">
127<dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt> 125<dt>Q: Sometimes Ctrl-C fails to stop my Lua program. Why?</dt>
128<dd>The interrupt signal handler sets a Lua debug hook. But this is 126<dd>The interrupt signal handler sets a Lua debug hook. But this is
129currently ignored by compiled code (this will eventually be fixed). If 127ignored by compiled code. If your program is running in a tight loop
130your program is running in a tight loop and never falls back to the 128and never falls back to the interpreter, the debug hook never runs and
131interpreter, the debug hook never runs and can't throw the 129can't throw the "interrupted!" error.<br>
132"interrupted!" error.<br> In the meantime you have to press Ctrl-C 130You have to press Ctrl-C twice to get stop your program. That's similar
133twice to get stop your program. That's similar to when it's stuck 131to when it's stuck running inside a C function under the Lua interpreter.</dd>
134running inside a C function under the Lua interpreter.</dd>
135</dl> 132</dl>
136 133
137<dl id="sandbox"> 134<dl id="sandbox">
@@ -145,28 +142,18 @@ it's very hard to get this right even for the Lua core libraries. Of course,
145you'll need to inspect any extension library, too. And there are libraries 142you'll need to inspect any extension library, too. And there are libraries
146that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br> 143that are inherently unsafe, e.g. the <a href="ext_ffi.html">FFI library</a>.<br>
147 144
148Relatedly, <b>loading untrusted bytecode is not safe!</b> It's trivial 145More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">&raquo;</span>&nbsp;Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)"><span class="ext">&raquo;</span>&nbsp;Wikipedia</a>.<br><br>
149to crash the Lua or LuaJIT VM with maliciously crafted bytecode. This is
150well known and there's no bytecode verification on purpose, so please
151don't report a bug about it. Check the <tt>mode</tt> parameter for the
152<tt>load*()</tt> functions to disable loading of bytecode.<br>
153 146
154In general, the only promising approach is to sandbox Lua code at the 147Relatedly, <b>loading untrusted bytecode is not safe!</b><br>
155process level and not the VM level.<br>
156 148
157More reading material at the <a href="http://lua-users.org/wiki/SandBoxes"><span class="ext">&raquo;</span>&nbsp;Lua Wiki</a> and <a href="https://en.wikipedia.org/wiki/Sandbox_(computer_security)"><span class="ext">&raquo;</span>&nbsp;Wikipedia</a>. 149It's trivial to crash the Lua or LuaJIT VM with maliciously crafted bytecode.
158</dd> 150This is well known and there's no bytecode verification on purpose, so please
159</dl> 151don't report a bug about it. Check the <tt>mode</tt> parameter for the
152<tt>load*()</tt> functions to disable loading of bytecode.<br><br>
160 153
161<dl id="patches"> 154<b>In general, the only promising approach is to sandbox Lua code at the
162<dt>Q: Why doesn't my favorite power-patch for Lua apply against LuaJIT?</dt> 155process level and not the VM level.</b>
163<dd>Because it's a completely redesigned VM and has very little code 156</dd>
164in common with Lua anymore. Also, if the patch introduces changes to
165the Lua semantics, these would need to be reflected everywhere in the
166VM, from the interpreter up to all stages of the compiler.<br> Please
167use only standard Lua language constructs. For many common needs you
168can use source transformations or use wrapper or proxy functions.
169The compiler will happily optimize away such indirections.</dd>
170</dl> 157</dl>
171 158
172<dl id="arch"> 159<dl id="arch">
@@ -176,17 +163,11 @@ machine code. This means the code generator must be ported to each
176architecture. And the fast interpreter is written in assembler and 163architecture. And the fast interpreter is written in assembler and
177must be ported, too. This is quite an undertaking.<br> 164must be ported, too. This is quite an undertaking.<br>
178The <a href="install.html">install documentation</a> shows the supported 165The <a href="install.html">install documentation</a> shows the supported
179architectures. Other architectures will follow based on sufficient user 166architectures.<br>
180demand and/or sponsoring.</dd> 167Other architectures may follow based on sufficient user demand and
181</dl> 168market-relevance of the architecture. Sponsoring is required to develop
182 169the port itself, to integrate it and to continuously maintain it in the
183<dl id="when"> 170actively developed branches.</dd>
184<dt>Q: When will feature X be added? When will the next version be released?</dt>
185<dd>When it's ready.<br>
186C'mon, it's open source &mdash; I'm doing it on my own time and you're
187getting it for free. You can either contribute a patch or sponsor
188the development of certain features, if they are important to you.
189</dd>
190</dl> 171</dl>
191<br class="flush"> 172<br class="flush">
192</div> 173</div>