lua-users home
lua-l archive

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


Ignacio Castaño wrote:

Hi,
I'm anoyed with the amount lua extensions out there. With lua extensions I
mean lua binaries that are linked with different libraries. The problem with
this approach is that you cannot use lua with two different libraries at the
same time. The only solution is to build your own lua, and that's only
possible if the source code of the libraries is publically available.
To solve that I would like to see a standard mechanism to write dinamic
libraries for lua. The requierements of that mechanism are very simple:

- A single entrypoint in the library: (i.e. Register(lua_State *) ) where
all the lua functions are exported.
- A new function in iolib (i.e. loadlib )

so you could do:

loadlib "wxlua"


and that would load the library, call the Register function, and add the
library to a table of loaded libraries, so that multiple calls to loadlib do
not load the library multiple times.

I was thinking about the exact same thing last night. I was surfing the web and I noticed that the author of SQL-Lite had a dynamic library that you could call from Tcl to access his dbms. I started thinking about all of the libraries that are available for Tcl and how easy it is to use them (just type "load mylib.dll"). I wish Lua had this.

I was thinkg along the same lines as Ignacio (but less technically, because I don't understand exactly how it all works). I know loadlib lets you call dlls. So if someone could maintain a compiled binary of "base" lua + loadlib, and then all of the extension authors could provide their library in the form of a dll that could be accessed through loadlib, this would give the lua community the same "ease of use" and functionality that Tcl now enjoys.

This would also satisfy a lot of the people, like me, who don't necessarily want to learn the ins and outs of C compiling. We just want a version of lua that has the libraries that we need.

Thanks, Ignacio, for bringing this up!

Jamey Cribbs