lua-users home
lua-l archive

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


On Sun, Apr 4, 2010 at 9:02 PM, Shaun McVey <shaun.mcvey@gmail.com> wrote:
> Wouldn't a safer approach be to be able to specify which functions
> from a module are loaded when you load the module?

Code analysis (think like a compiler) or bytecode analysis (think like
a linker) will get you _mostly_ there, but there's always going to be
cases that don't work in general. However, the workable cases are an
interesting majority ;)  After all, you _will_ test the result
thoroughly, using a set of tests?  And then you may have to explicitly
specify some imports.

Doing something like Penlight would pose interesting challenges,
because of the interconnectedness that happens in any bigger set of
libraries, and some of the trickery needed to make tables of functions
load-on-demand.

steve d.