Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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