lua-users home
lua-l archive

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


I am learning Lua and find it has no sciLua or numLua projects. (Python has many. And I don't know why python is a good language to do matrix computing.). I am wondering if no array in Lua is a problem to manipulate matrixes and vectors.

Does the following description imply that Lua is a good languge for scietific problems?

====================
Copied from http://www.tecgraf.puc-rio.br/~lhf/ftp/doc/jucs05.pdf
====================
Until Lua 4.0, tables were implemented strictly as hash tables: all pairs were
explicitly stored. Lua 5.0 brought a new algorithm to optimize the use of tables
as arrays: it optimizes pairs with integer keys by not storing the keys and storing
the values in an actual array. More precisely, in Lua 5.0, tables are implemented
as hybrid data structures: they contain a hash part and an array part. Figure 2
shows a possible con guration for a table with the pairs "x" ! 9:3, 1 ! 100,
2 ! 200, 3 ! 300. Note the array part on the right: it does not store the integer
keys. This division is made only at a low implementation level; access to table
elds is transparent, even to the virtual machine. Tables automatically and dynamically
adapt their two parts according to their contents: the array part tries
to store the values corresponding to integer keys from 1 to some limit n. Values
corresponding to non-integer keys or to integer keys outside the array range are
stored in the hash part.

==========================