Languages Features Calendar About Lists Add Language
GitHub icon



Lua is a programming language created in 1993 by Roberto Ierusalimschy.

Lua ( LOO-ษ™, from Portuguese: lua [หˆlu.(w)ษ] meaning moon) is a lightweight, multi-paradigm programming language designed primarily for embedded systems and clients. Lua is cross-platform, since the interpreter is written in ANSI C, and has a relatively simple C API. Lua was originally designed in 1993 as a language for extending software applications to meet the increasing demand for customization at the time. Read more on Wikipedia...

Try now: Riju ยท TIO ยท Replit

#23on PLDB 29Years Old 58.9kUsers

Example code from Riju:

print("Hello, world!")

Example code from hello-world:

print("Hello World")

Example code from the Hello World Collection:

# Hello World in Lua print "Hello world"

Example code from Linguist:

-- A simple counting object that increments an internal counter whenever it receives a bang at its first inlet, or changes to whatever number it receives at its second inlet. local HelloCounter = pd.Class:new():register("h-counter") function HelloCounter:initialize(sel, atoms) self.inlets = 2 self.outlets = 1 self.num = 0 return true end function HelloCounter:in_1_bang() self:outlet(1, "float", {self.num}) self.num = self.num + 1 end function HelloCounter:in_2_float(f) self.num = f end

Example code from Wikipedia:

$ cc -o example example.c -llua $ ./example Result: 8

Keywords in Lua

and break do else elseif end false for function if in local nil not or repeat return then true until while

Language features

Feature Supported Example Token
Conditionals โœ“
Functions โœ“
While Loops โœ“
Booleans โœ“ true false
Strings โœ“ "
Print() Debugging โœ“ print
Maps โœ“
Line Comments โœ“
-- A comment
Operator Overloading โœ“
Assignment โœ“
MultiLine Comments โœ“
A comment.
--[[ --]]
Comments โœ“
Semantic Indentation ฯด

Trending Lua repos on GitHub

repo stars description
nmap-vulners 1613 NSE script based on API
koreader 5226 "An ebook reader application supporting PDF DjVu EPUB FB2 and many more formats running on Cervantes Kindle Kobo PocketBook and Android devices"
guidanceSteering 174 Guidance Steering (AutoTrack) for Farming Simulator 19.
openface 12574 Face recognition with deep neural networks.
Codes-for-Lane-Detection 375 Learning Lightweight Lane Detection CNNs by Self Attention Distillation (ICCV 2019)
kong 23291 ๐Ÿฆ The Cloud-Native API Gateway
waifu2x 15744 Image Super-Resolution for Anime-Style Art
OTServBR-Global 57 OTServBR-Global 10x and 12x for OpenTibia community. | Supported by:
LuaPanda 329 Lua Debugger for VS Code

Books about Lua on goodreads

title author year reviews ratings rating
Programming in Lua Roberto Ierusalimschy 2001 21 323 3.97

Article source

PLDB - Build the next great programming language. v5.0.0 - Acknowledgements ยท Email ยท GitHub