lua-users home
lua-l archive

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


On Thu, 29 May 2003, Nick Trout wrote:
>
> I'm not sure what Python does with these containers; perhaps they
> have write barriers and they use mark and sweep?!

Looks like they have an optional incremental generational
mark-sweep-like thing, that cooperates with ref-counting.  I found
this explanation which is pretty clear:

http://arctrix.com/nas/python/gc/

> One of the reasons I moved away from Python towards
> Lua was that you don't have to deal with reference counting in the
> Lua API - which caused several annoying bugs when I first started
> using it. Lua is much simpler and it looks like Python is more
> complicated than when I left it.

Yeah, agreed about the ref-counting garbage in the Python API.  That
looks very error-prone.  I think the Lua API takes a safer approach by
requiring you to work through the Lua stack & registry/globals.  Lua's
API is encapsulated enough that C programmers don't need to know how
Lua does its GC.

-Thatcher