lua-users home
lua-l archive

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


On Wed, Oct 3, 2012 at 2:14 PM, David Collier <myshkin@cix.co.uk> wrote:
> maybe what we actually need is a "bytecode linker" that can
> include/exclude sections of bytecode before installation :-)

Possible, but so much easier to do in Lua code....

Curiously enough, I haven't done a classic #ifdef macro in LuaMacro,
but it's very do-able. It will look pretty much like the C
preprocessor, however, unless someone can think of a higher-level
construct.

The trouble with preprocessing Lua is that matching compile and
run-time errors up later isn't easy. So with LuaMacro (for instance)
the code is launched from LM and the line numbers of any errors are
patched for sensible output.  Thereafter it can of course generate
standalone Lua files.

Also, are the code and strings for debugging purposes so very large
that it affects Lua load time and performance?  Premature optimization
is an easy thing to get lost in...

steve d.