luacross-compiling

compiling lua script to standalone executable


is there a way to create a standalone executable from a simple lua scripts? by simple i mean: i'm just using what lua 5.1 provides.

if so, is there some sort of "cross-compiler" available? i would like create executables for a linux system on my mac osx system.


Solution

  • You can make Lua scripts executable with chmod +x and adding #!/usr/bin/env lua. But you'll need to have a Lua interpreter installed. For a different approach, see my srlua.