lua-users home
lua-l archive

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


David Burgess wrote:
This would allow an obsessive person to link the entire library tree
into a single DLL. :)


Neither Adrian nor I consider ourselves obsessive.

Wanting to bundle everything into a DLL, presents the same challenge
as when one has a library based filing system.

to use luasocket as an example (again) :
we have wrapped luasocket into a single windows dll. this means that we can deploy a simple 2-file solution : doit.lua and luasocket.dll. to try to get windows users to deploy multiple files => multiple directories requires a canned install. 3-4 files in a single directory they can (just-about) cope with.

to take things one step further : using bound resources (or lua->c), it becomes trivial to create a single executable + luasocket.dll.

when i tried to wrap (most of) xavante into a dll, i ran into the "require a.b" problem : my dll populated the preload table for all it's components when it was required(), but that's no good if a script requires a sub-component directly. i found work-arounds, but none i was happy with.

how about

require a.b
try a.b
try a_xxx
if a_xxx is found,
try preload a.b (unless a library loader will write out to disk, or change the search path, we don't need to retry the filesystem)

require a.b.c
try a.b.c
try a.b_xxx
if a.b_xxx is found,
try preload a.b.c
else
try a_xxx
if a_xxx is found,
try preload a.b.c ?

where xxx is one of lib/bundle/package/a nice word in the language of your choice

Adrian