Table of Contents

Lua Programming Language

Lua is a scripting language that is commonly embedded within other applications. It is very portable. You can learn to program Lua with the free ebook on the official website, Programming in Lua, 1st Edition.

Installing

In Debian you can simply use the package manager:

sudo apt install lua5.3

Also search for other packages with apt-cache search lua because there are a lot of libraries available like http, json, filesystem, curl, curses, databases and more.

If you want to build from source, it's very easy because it's so portable and written in ANSI C. Simply download, extract and run make.

wget http://www.lua.org/ftp/lua-5.4.3.tar.gz
tar zxf lua-5.4.3.tar.gz
cd lua-5.4.3
make  # sudo apt install build-essential
src/lua -v
src/luac -v
sudo make install  # Optional

Executing code

There are a few ways you could execute a script:

Hello World

hello_world.lua
print 'hello world'