1. Download LUA installation package
: Http://www.lua.org/download.html, currently the latest LUA is 5.2.3. Extracted by the doc, SRC, Makefile, readme a total of 4 files.
2. Compiling the LUA environment
1) Console CD LUA decompression path. 2) Execute make platform, I am mac, so do make macosx;3) generate LUA and luac two executable in SRC
File, these two files can be taken out separately, for example, we create the bin directory under the LUA decompression path, and put the generated executable file in.
3. Hello Lua
1) Console Direct output: (1) Execute under the LUA executable directory just generated:./lua, into the LUA environment. (2) Input: Print ("Hello Lua") Enter,
You can play Hello Lua and succeed. Control+d exiting the current LUA interactive command
2) Compile output by file: (1) Execute: Nano Hello.lua; (2) Enter: print ("Hello lua"), then execute Control+x;y;control M in turn.
At this point, Hello.lua is saved to the directory of the LUA executable file. (3) Execute./lua hello.lua to print hello Lua. (4) can also be compiled after execution:./luac Hello.lua. At this point in the Hello.lua directory generated Luac.out, execute./lua luac.out. You can also print Hello Lua.
Not finished, to be continued ~
Lua Learning "1": Setting up the environment under the Mac platform and the output and compilation of Hello Lua