lua-users home
lua-l archive

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




On 27/07/16 11:59 AM, Coda Highland wrote:
On Wed, Jul 27, 2016 at 7:55 AM, Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:
On Wed, Jul 27, 2016 at 3:29 PM, Javier Guerra Giraldez <javier@guerrag.com>
wrote:
On 27 July 2016 at 11:59, Egor Skriptunoff <egor.skriptunoff@gmail.com>
wrote:
Lua debugger should be able to display values of vararg even if they are
not
used in the function.
I think it's more important to let the compiler not to compile unused
resources

Are you talking about unused arguments elimination?
IMO, such optimization is pointless as it is almost never useful in final
code.

On the contrary, debugging of incompletely-written-functions is a common
case.
It is usual practice to comment out some parts of function's body while
searching for programming mistakes.
As a result, some arguments may become unused; and message like "vararg:
empty" (instead of list of actually passed values) in Lua debugger would be
very misleading.
It's useful when you're using polymorphism. Not every consumer will
need all of the data provided to it, but the API has to cater to the
broadest use.

It sounds like we might be getting to the point where a -O flag, or at
least a compile-time #define for debugger use, might be relevant if
we're seeing optimizations that have user-visible impact.

/s/ Adam

Not only is it user-visible but I've seen code that relies on this property (being able to take varargs and use debug.getlocal to access them, instead of ...).

And the reference manual says nothing about varargs elimination.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.