lua-users home
lua-l archive

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


On Mon, Jul 4, 2016 at 5:40 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2016-07-04 10:55 GMT+02:00 Philipp Janda <siffiejoe@gmx.net>:
>> Am 03.07.2016 um 18:43 schröbte Dirk Laurie:
>>> My proposal is that there should be a fixed-length array,
>>> allowing implementors to optimize for speed.
>>
>>
>> I'm not sure you'll get much speed out of this. There's not much you can do
>> except represent the array data as a C style array, which Lua already does.
>> You'd probably be able to save some memory though.
>
> I could continue the argument, but my heart is not really in it.
> I usually wear the "I like Lua the way it is" T-shirt. Lobbying
> for a new feature does not come naturally :-)
>

I generally agree with this, on the basis that this is not being
brought forth in the face of a real problem. For example, nobody is
saying, "I can't get my game to work because the performance of my
array library is lacking..."

1: Lua has only tables for structures and all other structures built on those.
2: Ordinality and length are two features that are often required. (I
imagine that some would say "sequences", but I think it comes down to
these two properties) Both can be implemented in tables, but they
could be even more efficient, if more help were provided from Lua.
3: The existence of a length operator provides much of the fuel for
this debate. So does the {...} notation.

There have been times when *a* solution to a problem would have been
easier to implement if the integral keys were always returned in
order. I'm guessing that this would be disruptive, but I mention it
because it's my least favorite limitation of tables / sequences.

-- 
Andrew Starks