Questions tagged [luac]

luac is the Lua compiler. It translates programs written in the Lua programming language into binary files that can be later loaded and executed.

luac is the Lua compiler. It translates programs written in the Lua programming language into binary files containing precompiled chunks that can be later loaded and executed.

The main advantages of precompiling chunks are:

  1. Faster loading;
  2. Protecting source code from accidental user changes;
  3. off-line syntax checking.

Precompiling does not imply faster execution because in Lua chunks are always compiled into bytecodes before being executed. luac simply allows those bytecodes to be saved in a file for later execution. Precompiled chunks are not necessarily smaller than the corresponding source. The main goal in precompiling is faster loading.

Precompiled chunks are not portable across different architectures. Moreover, the internal format of precompiled chunks is likely to change when a new version of Lua is released. Make sure you save the source files of all Lua programs that you precompile.

58 questions
1
vote
1 answer

Decompile Luac files - dealing with encryption

I've read from other questions on this site that luac files can be decompiled if you know the lua version. I've also read that the lua version is stored in the 5th byte of the luac file (the header). However here's the first few bytes of a luac file…
FraserOfSmeg
  • 1,128
  • 2
  • 23
  • 41
1
vote
1 answer

Lua C 5.1 - Iterating through all global values

Recently I have been exploring the luac 5.1 api and I was wondering if it is possible to loop through every global value in the 5.1 api, I know it is possible to do this in 5.2 ( referenced here ) as lua_pushglobaltable(lua_State*) exists. I know…
Batoda
  • 33
  • 3
1
vote
1 answer

Access Violation while creating Lua State

I have this simple program: #include int main() { lua_State * ls = lua_newstate(0, 0); lua_close(ls); return 0; } I put the Lua DLL in the right folder, linked the libraries, setup the include folder, and compiled. It…
Michael
  • 137
  • 1
  • 10
1
vote
1 answer

Questions about compiling Lua files

I want to compile my lua files to LuaC (myfile.luac). I'm using the Scite for compiling Lua. I haven't started until now, I heard, that I cannot compile my lua files to a 64 bit binary luaC file on a 32 bit system. So how can I compile lua to 32 bit…
luac
  • 11
  • 2
1
vote
2 answers

Compile Lua Code and store the bytecode in a new file

I know it is possible to compile the Lua code using LuaC as described here: luac is the Lua compiler. It translates programs written in the Lua programming language into binary files that can be loaded and executed with lua_dofile in C or with…
Alexandre Severino
  • 1,563
  • 1
  • 16
  • 38
1
vote
1 answer

How to get liblua5.1-0-dev for Windows 7?

I'm trying to compile VLC source code on a 64-bits Windows 7 machine. When running the configure file, it gives me an error message saying "configure: error: You need 32-bits luac when using using lua from contrib". So I searched it up on the…
ssss555
  • 33
  • 5
1
vote
1 answer

Batch file: program output in different folder

So I'm using luac to compile some .lua into .lub recursively through a batch file. I'm also having an issue that the output of the luac (same name as the .lua, but with .lub extension) is not going to the folder where the .lua was found. I've…
Marcelo Liberato
  • 434
  • 4
  • 12
1
vote
1 answer

Lua crashes when programs are compiled

I'm working on a very, very simple Lua program, trying to teach myself the language. Here's the three line program: file = io.open("hello.txt", "w") file:write("Hello, World.\n") io.close(file) When I use the program with Lua as a script, it works…
AndrewBurton
  • 407
  • 7
  • 16
1
vote
1 answer

How to access multidimensional table from lua in C?

Hello I am really stumped with this seemingly simple task. I can access the properties of a table passed to a function in C, but cannot access the members of any subtable i create in it. Basically I want to simply be able to extract the strings from…
PersuitOfPerfection
  • 1,009
  • 1
  • 15
  • 28
0
votes
1 answer

Textmate - Unable to locate luac

I installed lua bundle to Textmate, but when click on "check syntax" I get this error: Unable to locate luac To succesfully run this action you need to install «luac». If you know that it is already installed on your system, you instead need to…
networ
  • 179
  • 1
  • 8
0
votes
0 answers

Recompiling Lua files properly for KOF XIII

So recently decided to really knuckle down and try to figure out how to mod KOF XIII. The game utilizes Lua files, which are XOR encrypted with the key 0x66, and compiled. Made a Python Script to quickly decrypt them, as well as generate a ,bat that…
0
votes
0 answers

How to properly compile and link Lua C API with MinGW?

When compiling my code: #include #include ".\luac_headers\lua.h" #include ".\luac_headers\lauxlib.h" #include ".\luac_headers\lualib.h" int main() { const char* lua_code_buff = "print(\"hello from C.\")"; lua_State* l_state =…
XenixSX
  • 1
  • 6
0
votes
0 answers

MinGw "Luac" creates .out files instead of .exe files

When I use the MinGW Lua compiler, I get a Linux .out file, instead of a Windows .exe file. Is there a way I can compile it as an executable?
Da Mammoth
  • 19
  • 6
0
votes
1 answer

Cannot emplace_back to a vector that is also a function

So, I'm attempting to emplace_back a lua bytecode instruction into a vector, the issue is the function this is in has the type of vector, I'm trying to emplace_back to the function itself, that way I could declare a vector the the vector of the…
0
votes
0 answers

I GET ( Index was outside the bounds of the array) ERROR

hey guys Im trying to make a injector but i am getting error namespace AstromyJector { public partial class Form1 : Form { public Form1() { InitializeComponent(); } [DllImport("kernel32")] …