Luac - getting lua to start fast by precompiling
Archive - Originally posted on "The Horse's Mouth" - 2009-10-20 03:56:59 - Graham EllisLuac is Lua's Compiler ... using "luac" you can turn your Lua program into a binary (executable) file. Covered on Installing Lua on our Lua Programming and Learning to program in Lua courses.
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
The output file isn't actually a binary for the processor you're running on - it's an intermediate bye code format that saves compile time each time you load your Lua program. So Lua still has to be installed on your system (not an issue - it's open source and a very flexible license) and once it's actually running, it's no quicker. Rather like having a car with the engine running ... the get away is quicker, so it's great for short journeys but on a long journey the few cycles saved starting and warming up are lost into insignificance!