| View previous topic :: View next topic |
| Author |
Message |
sg57
Joined: 14 Oct 2005 Posts: 154
|
Posted: Thu Jun 15, 2006 3:39 pm Post subject: Convert LUA to C! IT WORKS!!!!!!!! |
|
|
YAY! Theres this tool in the actual Windows LUA Distribution called: bin2c
Its only but the source of it, so i messed with it a bit to print the Array of bytes to a file, thus converting the LUA to C, so ican use the:
luaL_loadbuffer(lua_State *L, const char *buff, size_t sz,
const char *name);
Call to convert those bytes to C via the intrepter...
what im asking here though, is... In order for me to use this, do i have to include all of the LuaPlayer source and what not?
Or just make sure i can complie what LuaPlayer was complied with...
I think there is 1 more function im looking for... since i heard u must use the lua_dobuffer to actually get it running...
Any thoughts on converting LUA to C anybody? Besides old fashion way? |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Thu Jun 15, 2006 7:17 pm Post subject: |
|
|
hehe but he is so close ....fact is you cannot convert
a script language like LUA into a high level language like C _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
|
| Back to top |
|
 |
ufoz
Joined: 10 Nov 2005 Posts: 86 Location: Tokyo
|
Posted: Thu Jun 15, 2006 9:38 pm Post subject: |
|
|
| It's probably storing some form of compiled lua bytecode, I thought this was always possible if you didn't want to keep text scripts around? It's been a while since I touched the lua sdk... (obviously you still need the interpreter/environment, duhh) |
|
| Back to top |
|
 |
lokust

Joined: 28 May 2006 Posts: 22
|
Posted: Thu Jun 15, 2006 10:18 pm Post subject: |
|
|
| ufoz wrote: | | It's probably storing some form of compiled lua bytecode, I thought this was always possible if you didn't want to keep text scripts around? It's been a while since I touched the lua sdk... (obviously you still need the interpreter/environment, duhh) |
Yeah, supposedly you can pre-compile your lua scripts and load them at run-time. But really, nine times out of ten wouldnt it be easiest (and most likely safer) to just convert it manually to c? |
|
| Back to top |
|
 |
|