First, download and install
(1) Latest release version
Http://www.lua.org/ftp/lua-5.3.1.tar.gz
(2) compiling
Building
Lua is implemented in pure ANSI C and compiles unmodified with all platforms that has an ANSI C compiler. Lua also compiles cleanly as C + +.
Lua is very easy to build and install. There was detailed instructions in the package but here's a simple terminal session that downloads the current release of Lua and builds it in Linux:
Curl-r-O http://www.lua.org/ftp/lua-5.3.1.tar.gztar zxf lua-5.3. 1. Tar . GZCD Lua-5.3. 1 make Linux test
For Mac OS X, use make macosx test
.
Normally it will appear: src/lua-v
(3) Installation
Then enter the "sudo make install" command, you will be asked to enter password: Enter the appropriate password (your password), and then enter the automatic installation
After the installation is complete can enter LUA-V, enter will see: Lua 5.3.1 Copyright (C) 1994-2015 lua.org, Puc-riook, has been installed successfully!
Second, using the IDE
1. Installing Sublime
2. Installing the LUA Compiler
Tools->build system->new Build System
Input:
{ "cmd": ["/usr/local/bin/lua", "$file"], "File_regex": "^ (... *):( [0-9]*):? ([0-9]*) ", " selector ":" Source.lua " }
Save As Lua.sublime-build and then choose Lua on the tools-build system to compile the script.
3. Writing LUA code using sublime
Lua's editing and operating environment has been set up to create a new Hello.lua file, write a statement, choose LUA as the build system, click Command+b, you can run out.
Build a LUA environment on your MAC