lua-users home
lua-l archive

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




John Hind wrote:
I think perhaps the issue here is that the Module system has encouraged a
move to writing libraries in Lua or in composites of Lua and C rather than
in pure C. This introduces an implicit assumption that the target
architecture will present a file system in which to store the Lua code, an
assumption that is not made by the Lua core or standard libraries.

I think it's ok to have Lua code in a library. And I think each platform has a best way to handle the loading of this code.

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!

Although there is somewhere in the Internet some code to load a DLL from memory (which could had been loaded from anywhere), I doubt anyone would want to use except as a toy or for better understanding the PE file format.

I'll post the link if I can find it again.

Cheers,

Andre