[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Proper tail recursion
- From: Thatcher Ulrich <tu@...>
- Date: Thu, 26 Jul 2001 22:03:55 -0400 (EDT)
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
> 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?