lua-users home
lua-l archive

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


hello,
	i am new to lua. i just found it two days ago and
compared it with other scripting languages like
cslang, simkin and python. and finally decided to use
it in my real-time high speed virtual experimentation
tool (in C++ and fltk ) because of it's speed.i also
joined this mailing list just yesterday.
  and this morning i found that u have written such a
good tool for converting lua code to C. i think this
will help me a lot, atleast it will show me a way, for
my interface to lua from C++. i think tools like lua2c
and jlua will help lua's proliferation.  thumbs up for
writing a very good tool.
bye  :-)
Ashish
India

--- Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> I've followed Russell Webb's suggestion and wrote a
> Lua -> C converter.
> You can get it at
> ftp://ftp.tecgraf.puc-rio.br/pub/lhf/lua2c.tar.gz .
> 
> lua2c does not understand arbitrary Lua programs but
> is pretty useful.
> Here is what it does to an example in the reference
> manual:
> 
> In Lua:
>     a,b = f("how", t.x, 4)
> 
> In C:
>     lua_getglobal(L,"f");
>     lua_pushstring(L,"how");
>     lua_getglobal(L,"t");
>     lua_pushstring(L,"x");
>     lua_gettable(L,-2);
>     lua_remove(L,-2);
>     lua_pushnumber(L,4);
>     lua_call(L,3,2);
>     lua_setglobal(L,"b");
>     lua_setglobal(L,"a");
> 
> Please send comments, suggestions, and bug reports
> directly to me.
> Enjoy.
> --lhf


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com