lua-users home
lua-l archive

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


On 17 February 2011 10:00, steve donovan <steve.j.donovan@gmail.com> wrote:
> On Thu, Feb 17, 2011 at 11:48 AM, T T <t34www@googlemail.com> wrote:
>>  vec3 = vec1 + vec2
>>
>> to add together two arrays and the good elves take care of the rest,
>> but in Lua we have to write loops.
>
> Well, it's traditionally done with objects, and this creates a great
> deal of garbage (I recall Leo talking about this very thing.) The
> elves turn out to be quite expensive.

MATLAB implements those quite efficiently, but that besides the point
of this discussion.

> IHMO, this is not the job of a standards-approaching implementation of
> Lua, but a dialect that gets translated into Lua.

You missed my point, which was that we can't avoid writing those loops in Lua.

> An entertaining project for anybody with a bored graduate student is
> to explore some ideas behind this kind of Template Lua, which converts
> TL into regular Lua for fast execution.

I can't understand why so many people here are so fixated on this
templating idea without exploring simpler possibilities.  Have you
missed my example with unrolling?  Surely, it should be possible to do
something like that in the compiler/interpreter (and probably much
better, since you have the extra run-time info to help you).  Why add
another layer of complexity?  That should be the last resort, unless
the current situation is set in stone.  Let's first wait on what Mike
will say.

Cheers,

Tomek