[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT without the JIT?
- From: Alex Queiroz <asandroq@...>
- Date: Thu, 23 Jun 2011 14:11:15 +0200
On Thu, Jun 23, 2011 at 12:41 PM, Francesco Abbate
> The dualism between static analysis (like with C) and trace analysis
> is strictly tied to the dualism between programming languages with
> static and dynamic typing. This latter kind of languages like Lua or
> Python does not admit a static compilation by design because you don't
> have any information about what type of value a variable can contain,
> the information is only available at run time. Also the mechanism of
> table lookup that is extensively used in Lua and Python does not allow
> any static analysis because the information are available only at run
> time and everything can change during the execution.
This is not true. It is possible, practical and worthy to do
static analysis in dynamic-typed languages implementations. The
literature on this span decades. The "static" here is not about
typing, but instead "analysing without running the code." I myself
have implemented dead-variable elimination, removal of unused
arguments, inlining and removal of known procedures etc. Besides these
simple ones, you can lift computations out of loops (no trace needed
in several cases), do especulative inlining, partial evaluation etc.
Really, you can do *a lot* before running the code.