lua-users home
lua-l archive

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

I prefer to use a bin2c.lua script instead of the C code that comes with Lua.

You'll find it i.e. within the Lanes sources, which bakes in some Lua code into its binary module.

I don't use the package mode (i.e. 'require') for getting at these portions, though.


Grant Robinson kirjoitti 27.11.2008 kello 8:32:

I'm using Lua for a library that exposes a C API, but internally is
using Lua for some of the functionality.  I would really like to embed
my Lua modules directly into the binary.  Having done some perusing of
Google and friends, it appears that bin2c (from
<>) and the LOOP pre-compilation and
pre-loading scripts (from
<>) both look like fairly
decent possibilities.  I was hoping to get some feedback of what
approaches others here have used, and what people have found that
works best.  Most of the Lua code that I would like to embed is
written using the Lua 5.1 package model, so that is a consideration
that needs to be kept in mind.

Any feedback would be greatly appreciated.


Grant Robinson