[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: RES: package system modification (module loaders)
- From: Jamie Webb <j@...>
- Date: Mon, 17 Jan 2005 14:41:26 +0000
On Tue, Jan 18, 2005 at 12:28:51AM +1100, skaller wrote:
> The problem left open seems to be how to install
> C extensions, and packages that need them.
That's in there too. The new require() picks up shared libraries from
package.cpath and calls the C function luaopen_<package_name>(). The
C code sets up an array of functions to expose and calls
luaL_openlib() to register them. If you want to use
linked-in-but-not-registered modules, just stick the luaopen_*
function in package.preload.
I haven't tried Python, but I understand Lua is easier.
> I guess things will get even more difficult in 5.1
> because of the write barrier, however, probably not
> as bad as managing ref-counting in Python (which is
> a nightmare ..)
Not at all. The only way to modify Lua references is through the API,
which will deal with all the memory management issues for you. It's
very simple. There's some ugliness once you start having the
possibility of cyclic references between C and Lua, but that's another
-- Jamie Webb