![√](img/ok.gif)
Forum
![>](img/i_next.png)
![>](img/icons/offtopic.png)
![>](img/i_next.png)
lua to luac
8 replies![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)
![√](img/ok.gif)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
inputFileName = "input file.lua" outputFileName = "output file.lua" inputFunction = assert( loadfile( inputFileName ) ) outputFile = io.open( outputFileName, "wb" ) outputFile:write( string.dump( inputFunction ) ) outputFile:close()
Simplest way I believe.
luac(.exe) -o Outputfilename.luac script1.lua script2.lua
Lua binaries has written
luac:
usage: luac [options] [filenames].
Available options are:
- process stdin
-l list
-o name output to file 'name' (default is "luac.out")
-p parse only
-s strip debug information
-v show version information
-- stop handling options
usage: luac [options] [filenames].
Available options are:
- process stdin
-l list
-o name output to file 'name' (default is "luac.out")
-p parse only
-s strip debug information
-v show version information
-- stop handling options
![file](img/i_file.png)
![cs2d](img/icons/cs2d.png)
edited 1×, last 01.02.17 10:53:12 am
Way faster to compile a Lua file into .luac just within few clicks - doing some researching won't hurt. Unless you want to have all the control over how you compile the file then you have got to implement the Lua compiler yourself and run the command from
![user](img/i_friend.png)
https://mothereff.in/lua-minifier
http://luasrcdiet.luaforge.net/
https://github.com/LuaDist/luasrcdiet
luac(.exe)method posted by
![user](img/i_friend.png)
string.dump()(
![user](img/i_friend.png)
![user](img/i_friend.png)
luac -s -o <output> <input>would destructively compile it (notice the
-sargument which tell luac to strip debug information).
EDIT: Also you need to use 32-bit LuaC! 64-bit LuaC will lead to incompatibility because Lua bytecode depends on architecture (integer size)
edited 1×, last 09.02.17 02:32:57 pm
![user](img/i_friend.png)
![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)