lua-users home
lua-l archive

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


I guess Bruce Dawson is right in pointing out the reference
counting v.s. garbage collecting issue with Python. Lua's
GC still needs quite a lot of work before large chunk of Lua
code can be safely embeded into games without worry.

I've recently replaced Lua 4.0's garbage collector with Hans-J. 
Boehm's conservative C garbage collector. It sort of works,
but the result isn't good. Boehm's C collector slows down
the speed of Lua quite significantly (by 28% using the 
lua/test/life.lua as a test). And the substitution in my own
game resulted in nonstop growing memory usage when incremental 
GC is turned on for Boehm's C collector.

In my case, I've got 80k lines of Lua code in my game (50k
lines are data though), I'd call the result tolerable, but
definitely not satisfying, because I cannot achieve constant
frame rate.

I guess before Lua gets a generational collector and meets the
requirement of soft realtime, it isn't suitable for large
scale scripting in games.

Besides GC issues, I don't see any real advantage in choosing
Python over Lua. Lua does an exellent job at being embeded.

Regards,
liuhai

On Thu, Aug 22, 2002 at 10:52:17AM -0300, Andre Carregal wrote:
> Hi there,
> 
> Gamasutra has an article by Bruce Dawson where he explains why he choosed
> Python over Lua:
> 
> http://www.gamasutra.com/features/20020821/dawson_01.htm
> 
> The rationale was:
> 
> "Lua is smaller and probably easier to embed in an application, and has some
> nice language constructs. However, at the time we were choosing a language
> the documentation was a bit sketchy. This is probably because Lua is a newer
> language than Python.
> 
> Python has more extension modules than Lua, more books written about it, and
> stackless Python [Tismer01], which was a promising way of creating
> micro-threads for object AI. We ended up not using the stackless version of
> Python, but we did start using Python for writing automated build scripts
> and this gave us momentum. We knew the syntax, we liked it, and so we chose
> Python.
> 
> Both languages have been improved since we made our decision - Lua has
> become stackless and Python has acquired generators, which allow some
> similar functionality. Either language is a safe choice."
> 
> What if someone using Lua in game development wrote a similar article for
> Gamasutra? Or if the Lua team submitted some Lua reference material to
> Gamasutra? The site is very popular in the game development community.
> 
> Andre Carregal
>