lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 26 Jul 2001, Luiz Henrique de Figueiredo wrote:

> >Interesting.  Well, how about an *optional* optimizer, which takes in Lua
> >bytecode, looks for optimizations like that, and outputs the optimized
> >bytecode.  I don't know much about Lua internals... does that sound
> >feasible?
>
> The main point is that there are no such things as tail recursions, because
> global names are resolved at runtime.

Right, it wouldn't be able to find tail recursion.  I was thinking the
optimizer would apply to the idea you mentioned of having "true" local
variables on the stack, which isn't feasible now because the compiler uses
only one pass.  Maybe there are a whole batch of other shallow
optimizations that could be done as well?

-Thatcher