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.

	http://luaforge.net/frs/?group_id=265&release_id=1142

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

-asko


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
<http://lua-users.org/wiki/BinToCee>) and the LOOP pre-compilation and
pre-loading scripts (from
<http://loop.luaforge.net/release/preload.html>) 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.

Thanks!

--
Grant Robinson