[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [UNANTICIPATED SIDE EFFECT] debug.getlocal does not pick up vararg (Was: [BUG]
- From: Coda Highland <chighland@...>
- Date: Wed, 27 Jul 2016 07:59:52 -0700
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