English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Lua Environment Installation

Installation on Linux System

Installing Lua on Linux & Mac is very simple. You just need to download the source code package and decompress and compile it in the terminal. This article uses5.3Install version .0:

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

You can also install Lua on Mac through homebrew, which is convenient for version management.

brew install lua

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!

Install Lua on Windows System

On Windows, you can use an IDE environment called "SciTE" to execute Lua programs. The download address is:

Double-click to install and you can write and run Lua programs in this environment.

You can also use the method recommended by the Lua official website to use LuaDist:http://luadist.org/