lua-users home
lua-l archive

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


It's no standard and probably not suitable to become one but since I
wrote it for just the reasons described by Tom I might as well mention
luaarray.  I wrote it because my project will rely heavily on large
array data (images, sounds, geometry and the like) and I wanted an
efficient and consistent way of passing them around while still
keeping the feel of real Lua values instead of just opaque objects.
More information below.

http://www.nongnu.org/techne/lua/luaarray/

Dimitris

On Fri, Sep 28, 2012 at 10:17 AM, Marc Balmer <marc@msys.ch> wrote:
> Am 28.09.12 03:26, schrieb Tom:
>> I'm sorry, but people seem have been missing the point of my question.
>>  It is easy to implement a typed array for Lua; I have several such
>> implementations myself (binding vector with luabind is one easy such
>> implementation).
>>
>> The problem is that everybody is doing it differently.  Libraries that
>> use large typed arrays (e.g., 3D graphics, image processing, etc.) each
>> have their own typed array data types and it is impossible to move data
>> efficiently from one to another without writing yet another extension.
>>
>> Therefore, I think it would be good if there were a STANDARD for typed
>> arrays, something that every extension that uses typed arrays can use as
>> the basis for its own typed arrays, or at least provide conversions
>> to/from.  That's the reason Python and JavaScript moved typed arrays
>> into the core, and I think it would be good for Lua to consider doing
>> this too. It doesn't need to have many (or even any) operations on it,
>> but it does need a C API that is available and acceptable to all
>> extension writers.
>
> That API is alreday there and I use it heavily when I move data from/to
> Lua.  It is the Lua C API where you can easily (and recusively, if you
> want) iterate over the elements of a table, get the elements data type,
> and act accordingly.
>
>