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