G.H. | 1 Jan 04:20
Picon
Gravatar

Re: Table compare

Sorry if I disturb some people now that the main
subject has changed. Just want to say thanks to
those who bothered sharing their insights into
table comparison.  Specially Alex.

BTW. metatable and "pre-linking" approaches
worth checking out. 

Best Regards.

--
Mario García H.

David Manura | 1 Jan 04:56
Favicon

Re: A rant about Lua

On Wed, Dec 31, 2008 at 5:17 PM, Benjamin Tolputt wrote:
> On 12/31/08, Lee Hickey wrote:
>> http://julien.danjou.info/blog/index.php/post/2008/12/30/Rants-about-Lua
> I don't understand why the '#' syntax does not use the __len metamethod

See http://lua-users.org/wiki/LuaFiveTwo concerning __len, __pairs,
and __ipairs.

Note that in contrast to the proposed __len metamethod for tables, the
proposed __pairs/__ipairs metamethods are not integral to the Lua VM.
They are used only conventionally by the pairs/ipairs iterator
functions.  You can alternately use your own iterator functions, even
ones that honor __pairs/__ipairs, or redefine pairs/ipairs from Lua.

I'm not certain if next and lua_next are in any way affected though in
5.2 (perhaps not).

>From the blog:
> The problem is that standard functions like table.insert or
> table.remove do raw accesses to the table.

True, the table.* functions use raw gets/sets.  I think these would be
better named array.* since they are mostly, though not exclusively,
designed for "raw arrays"--i.e. tables containing positive integer
keys and lacking overridden operators defined in a metatable. This is
in contrast to metatable-backed tables or userdata used to represent
interfaces to abstract data types with overridden operators.  A
typical example of raw arrays is for efficient /internal/
implementations--an algorithm inside a function or internal storage
for a data type.
(Continue reading)

KHMan | 1 Jan 05:32
Picon

Re: A rant about Lua

David Manura wrote:
> On Wed, Dec 31, 2008 at 5:17 PM, Benjamin Tolputt wrote:
>> On 12/31/08, Lee Hickey wrote:
>>> http://julien.danjou.info/blog/index.php/post/2008/12/30/Rants-about-Lua
>> I don't understand why the '#' syntax does not use the __len metamethod
> 
> [snip]
> 
>>From the blog:
>> The problem is that standard functions like table.insert or
>> table.remove do raw accesses to the table.
> 
> Therefore, I question why table.* functions should honor metamethods.
> If you want your ADT to have an "insert" operation, you could
> implement it as a dynamically bound method:
> [snip]

It looks like the blogger has failed to do a mental/cognitive 
switch. If he likes OO-across-the-board so much, there's something 
called Ruby that might agree with his fine tastes. I hear it's 
very fast too... ;-) Heh. Selamat Tahun Baru [Malay] to everyone too.

--

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

David Manura | 1 Jan 05:55
Favicon

Re: Opcode dispatch

On Mon, Dec 29, 2008 at 3:24 PM, Samuel Greear wrote:
> ...I have seen a 1.5-28% performance increase...
> http://evilcode.net/sjg/patches/lua.patch

Here's a few runtime comparisons on some of my Lua only code, with Lua
compiled using "make linux" (gcc -O2) under Cygwin / P4.

Runtimes for the pure Lua implementation of the DEFLATE/gzip
algorithm[1] on decompressing lua-5.1.4.tar.gz with CRC checking
enabled:

  unpatched: 10.107 / 10.831 / 10.112 s
  patched:     9.306  / 9.285   / 9.308   s
  (About 10% faster.)

Runtimes for 50 iterations of the LuaMatrix[2] test suite:

  unpatched: 10.931 / 10.901 / 10.872 s
  patched:     11.283 / 11.095 / 10.881 s
  (Not conclusive.)

Runtimes for StringLibraryInLua[3] performance test (perftest.lua):

  unpatched: 35.615 / 36.759 / 34.527 s
  patched:    36.149 / 35.362 / 33.285 s
  (Not conclusive.)

[1] http://lua-users.org/wiki/ModuleCompressDeflateLua
[2] http://lua-users.org/wiki/LuaMatrix
[3] http://lua-users.org/wiki/StringLibraryInLua
(Continue reading)

Bertrand Mansion | 1 Jan 10:03
Gravatar

Re: Happy New Year,

Bonne année à tous !
This will be another great year for Lua !

On Wed, Dec 31, 2008 at 4:31 PM, Erik Hougaard <erik <at> hougaard.com> wrote:
> "Godt Nytår" (in Danish) to all on the Lua List. And all the best wishes for
> Lua and everybody in 2009 !
>
> /Erik
>
>
>
>

--

-- 
-----
Bertrand Mansion
Mamasam
Lan Qing | 1 Jan 10:59
Picon

Re: Happy New Year,

新年快乐!!!


On Thu, Jan 1, 2009 at 5:03 PM, Bertrand Mansion <lua <at> mamasam.net> wrote:
Bonne année à tous !
This will be another great year for Lua !

On Wed, Dec 31, 2008 at 4:31 PM, Erik Hougaard <erik <at> hougaard.com> wrote:
> "Godt Nytår" (in Danish) to all on the Lua List. And all the best wishes for
> Lua and everybody in 2009 !
>
> /Erik
>
>
>
>



--
-----
Bertrand Mansion
Mamasam

PhiLho | 1 Jan 11:53
Picon

Re: Happy New Year,

No French yet?

Bonne année et bonne santée pour 2009 !

(Happy new year and I wish you good health for 2009, the most common 
wish for new year... :-))

dcharno | 1 Jan 16:21
Picon
Gravatar

Re: A rant about Lua

> It looks like the blogger has failed to do a mental/cognitive switch. If 
> he likes OO-across-the-board so much, there's something called Ruby that 
> might agree with his fine tastes. I hear it's very fast too... ;-) Heh. 
> Selamat Tahun Baru [Malay] to everyone too.

You are right.  Any one who comments on, questions or criticizes any 
aspect of Lua should just switch to another language.

Peter Cawley | 1 Jan 17:16
Favicon

Gems chapter 2 memory usage numbers

>From page 23 of Lua Programming Gems: "For a polyline with one million
points, this change reduces the use of memory from 95 KBytes to 65
KBytes ... With this representation, a one-million-point polyline uses
only 24 KBytes of memory."
These numbers appear to be out by many orders of magnitude; one
million points (10^6, each having x and y) in 95 KBytes (~10^5 bytes)
is impossible, and the same number of points in ~24*10^3 bytes is even
more impossible. I can't help but feel that collectgarbage("count")
was used to get these numbers, and the result was interpreted as the
number of bytes rather than the number of kilobytes. If this were the
case, then the true numbers would be 95 MBytes, 65 MBytes and 24
MBytes respectively, which seem much more likely numbers.

KHMan | 1 Jan 17:25
Picon

Re: A rant about Lua

dcharno wrote:
>> It looks like the blogger has failed to do a mental/cognitive switch. 
>> If he likes OO-across-the-board so much, there's something called Ruby 
>> that might agree with his fine tastes. I hear it's very fast too... 
>> ;-) Heh. Selamat Tahun Baru [Malay] to everyone too.
> 
> You are right.  Any one who comments on, questions or criticizes any 
> aspect of Lua should just switch to another language.

No, that is a bit too extreme. Let us not be opposed to different 
opinions, but let us respect the right to differ in opinions. So, 
while I respect the blogger's opinions, I don't agree with it. No 
big deal.

We wouldn't want to push anyone away. I respect the blogger's 
ability to make his own choices. Anyway, we have ideas and 
opinions discussed on the list all the time... Give-and-take 
discussions seem to be disappearing in this age where things often 
gets too politically correct, a pity.

David has explained much of it. It is a different way of thinking, 
that's all. But lots of people have modified or extended Lua anyway.

--

-- 
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


Gmane