Lua environment installation


Installation on Linux system

Installation of Lua on Linux & Mac is very simple. You only need to download the source code package and decompress and compile it in the terminal. This article uses version 5.3.0 for installation:

curl -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.3.0
make linux test
make install



Installation on Mac OS X system

curl -R -O http://www.lua.org/ftp/lua-5.3.0.tar.gz
tar zxf lua-5.3.0.tar.gz
cd lua-5.3.0
make macosx test
make install


Next we create a HelloWorld.lua file with the following code:


print("Hello World!")

Execute the following command:

$ lua HelloWorld.lua

The output result is:

Hello World!

Window Install Lua on the system

window Next, you can use an IDE environment called "SciTE" to execute the lua program. The download address is:

  • The download address of this site: LuaForWindows_v5.1.4-46.exe

  • Github download address: https://github.com/rjpcomputing/luaforwindows/releases

  • Google Code download address: https://code.google.com /p/luaforwindows/downloads/list

After double-clicking to install, you can write and run Lua programs in this environment.

You can also use LuaDist using the officially recommended method of Lua: http://luadist.org/