I've been looking at Lua and Löve for developing simple 2D games. But since Lua is interpreted and I know it can be compiled to some point, but how secure is that to decompiling. Or is there a better way to distribute the game?


closed as off-topic by Josh Nov 11 '14 at 17:09

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions that aren't specific to game development are off-topic here, but can be asked on Stack Overflow. A good rule of thumb is to ask yourself "would a professional game developer give me a better/different/more specific answer to this question than other programmers?"" – Josh
If this question can be reworded to fit the rules in the help center, please edit the question.


You can precompile lua using the luac tool in the standard distribution:

luac myluafile.lua -o mycompiledluafile.luac

To obfusticate the file, use the -s option to remove all the debug info. This won't make you immune to decompiling, but why does that matter?

The -l option produces an annotated bytefile, which is really nice for learning how lua works deep down.

The main advantages of compiling are faster loading times and smaller disk space. However you don't get a performance increase after that - the lua compiler does very little optimisations, even to the point of still including if(false) branches and the like.

  • \$\begingroup\$ Lua bytecodes are not specified to be portable, or even acceptable -- they are considered an implementation detail, not an actual part of the language. In particular, I believe that LuaJit-based runtimes will simply have nothing to do with them. \$\endgroup\$ – Textmode Nov 12 '14 at 9:51
  • \$\begingroup\$ love2d.org/wiki/luac <- Löve wiki on luac'd bytecodes; note the policy about "we don't actually support it" was added by 'Bartbes' himself. \$\endgroup\$ – Textmode Nov 12 '14 at 9:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.