[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __index returns truncated to one, why?
- From: Andrew Starks <andrew.starks@...>
- Date: Thu, 10 Apr 2014 15:44:01 -0700
On Thu, Apr 10, 2014 at 10:26 AM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> On Thu, Apr 10, 2014 at 11:41 AM, steve donovan
> <steve.j.donovan@gmail.com> wrote:
>> And that's exactly the point - even experienced users of the language
>> would not know what to expect, because there _could_ be a magic
>> metamethod.
>>
>> -1 for this one, it really causes confusion.
>
>
> IMHO, all this is because there's no real tuple value type, and we're
> treating the varargs '...' and multiple return values as some "almost
> a tuple" thing. but it's not the same thing.
>
> a real tuple type, with destructuring assingments, would solve all
> this in a simple and transparent way. but replacing varargs with a
> tuple or list, and multiple return values with returning a tuple just
> to be immediately destructured might have a serious performance
> impact, likely from a huge increase in object allocation (except if
> you're using LuaJIT and Mike's magic banishes all those temporary
> objects from existence)
>
Whenever I hear about avoiding temporary tables, I wonder if the
concern is based on theory, micro benchmarking or real-world
application problems.
I know that it is true that performance and garbage collection are "a
thing." At first, I went through some effort to avoid that in some of
my code. Now, I've stopped because I've never been able to whiteness a
side effect of creating a ton of temporary tables.
Is avoiding temporary tables an effort that is worthy on tiny
micro-controller but not on a PC? Are there times when this flavor of
small, temporary garbage has really mattered, even on a PC?
I'm doing all of my logic inside of the few mills between frames that
I can afford to steal away from the C code that actually does the
heavy lifting and I've never been able to measure *any* impact.
-Andrew
> --
> Javier
>
- References:
- __index returns truncated to one, why?, duz
- Re: __index returns truncated to one, why?, Dirk Laurie
- Re: __index returns truncated to one, why?, Andrew Starks
- Re: __index returns truncated to one, why?, steve donovan
- Re: __index returns truncated to one, why?, Dirk Zoller
- Re: __index returns truncated to one, why?, steve donovan
- Re: __index returns truncated to one, why?, Duncan Cross
- Re: __index returns truncated to one, why?, Sean Conner
- Re: __index returns truncated to one, why?, Thiago L.
- Re: __index returns truncated to one, why?, steve donovan
- Re: __index returns truncated to one, why?, Javier Guerra Giraldez