Locals are registers (Re: A guide to building Lua modules)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Locals are registers (Re: A guide to building Lua modules)
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2014年4月17日 08:03:17 +0200
2014年04月16日 23:46 GMT+02:00 Sean Conner <sean@conman.org>:
> Fixing this in Lua would be a massive internal overhaul of how the
> compiler works, and most likely make Lua slower. The reason locals are
> faster than table lookups is that locals are really VM registers, which
> also explains why locals can't be declared at runtime.
And why there can be no more than 200 of them per scope.
>> and varargs not being easier to store/handle
However, varargs and return lists are also registers.
> (there are things I would love to change about C, but I'm realistic
> enough to know that I have as much chance as Cnut stopping the
> waves).
If Cnut is a C hobbyist, a Lua enthusiast is a Brazil nut.