lua-users home
lua-l archive

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


2009/9/5 John Hind <john.hind@zen.co.uk>:
> This is easily fixed on the Windows environment because Windows executables
> have support for embedded resources and it is straightforward to provide a
> loader so Lua "require" looks for Lua code in resources. Unfortunately, this
> is not portable to other platforms. Also unfortunately you cannot load dll
> files from resources, so you still must statically link the C parts of
> composite libraries (not usually any problem, but it would be nice ...)
>
> This problem is not unique to Lua and it afflicts all "scripting" languages
> (just look at how many files the Firefox browser tips into your file
> system!). What's needed is a generic "meta-executable" format that embeds a
> virtual file system and makes it available to a normal executable (in this
> case a Lua runtime) stored in the same file. Any examples of such systems I
> can find extract content out to temporary files, which rather spoils the
> point!

Just for the sake of precision, I'd like to point that while the
standard Windows DLL loader is not capable of loading DLLs from
another DLL resource, afaik all its features are reproducible in user
code (it's not using kernel black magic). Therefore it's possible to
load DLLs from anywhere. Some libraries out there allow loading DLLs
from in-memory buffers with the exact same capabilities and interface
as the standard win32 LoadLibrary+GetProcAddress.