lua-users home
lua-l archive

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

Ralph Hempel writes:
> Asko Kauppi wrote:
> > Oh, btw: it won't generate C code for you.  It gives you a binary chunk 
> > of Lua code that can be embedded in a C program.  Is that what you want?
> I think based on his original post that he wanted a magic
> translator that provided working .c and .h files for a given
> .lua file.

This may be referring to a "Lua source -> C source" compiler I've been working
on since last week that is tentatively named lua2c and implemented as lua2c.lua.
 I planned to announce it on this list sometime this week, but current work can
be found on the wiki in the Recent Changes.

Please note the warnings!  lua2c.lua is in active development and not intended
for general consumption (at least not yet).  Neither are previous "lua2c/luatoc"
efforts by Lhf and Hisham.  Most people will instead want to run Lua source
directly from C by calling C API functions (e.g. luaL_loadstring / luaL_dostring
/ luaL_loadfile / luaL_dofile functions) or, as an optimization as Asko
mentioned, precompile to bytecodes (luac) and/or embed it in your binary
(bin2c).  luac is included with Lua, and bin2c can be found at [1].