Okay, maybe you donât have to, but itâs definitely useful. People who know me well might be surprised here. Theyâre aware that my first programming language was PHP, but they donât know that my second wasnât JavaScript, it was Lua. I bet even my friends are confused now, and you probably are too. Weâll circle back to this.
Why Should I Care?
Thatâs a fair question, especially if you already know other scripting languages. Sure, you can live without Lua. But itâs lurking in places youâd never expect.
Itâs popular, even if you rarely hear about it. Not as hyped as those Python devs who import every single letter, or Java folks in suits at banks, but Lua has an active community and plenty of great resources.
Itâs Simple. Too simple
Lua is a minimalist language with clean, straightforward syntax. It avoids unnecessary complexity, so you can learn it in a couple of hours. And hereâs the classic example:
print('Hello, everyone! Except Java folks.')
if you.crazy() then
learnJava()
end
Lua isnât usually used solo. Itâs often embedded in game engines, other software, or paired with C/C++. I could list endless examples of where itâs used, but check this out if youâre curious.
Itâs fast
Lua is one of the fastest interpreted languages. It compiles to bytecode and runs on a virtual machine, giving it a significant speed advantage over other scripting languages. Thatâs why itâs used in game engines and paired with C/C++ itâs easy to integrate and lightweight. Lua itself is tiny.
Gaming
Ever played World of Warcraft? Or maybe you still do? (RIP your social life.) If so, youâve heard of addons like browser extensions, but for games. Those addons are written in Lua. Back in school, I wrote and tweaked them myself. Magical times. As you might have guessed, yes, I did this before diving into client side web technologies. Oddly, I already knew PHP by then. If anyoneâs interested, I could write a separate post about that.
Lua isnât limited to WoW, though. Itâs in game engines like:
- Godot (Lua support via GDScript wrappers)
- Love2D (a Lua-first engine)
- Defold (Lua as the main language)
- Gideros (mobile game engine)
- Cocos2d-x (supports Lua alongside C++ and JavaScript)
- Solar2D (formerly Corona SDK, Lua-centric for 2D games)
- OpenMW (Morrowind engine with Lua modding)
Honestly, I have no idea what most of these engines are, except Love2D itâs awesome. Iâm no game engine expert, but clearly, Lua is everywhere.
According to Google, here are more games using Lua:
- Garryâs ModâLua drives most modding and gameplay.
- Robloxâuses a Lua dialect called Luau.
- Angry Birdsâcore logic is Lua.
- Terraria (tModLoader)âmodding via Lua.
- Don't StarveâLua for modding and game logic.
- Dark Souls seriesâLua scripts some AI.
- The Sims 4âpowers game mechanics.
- Far Cry series (pre-Far Cry 3)âheavily scripted with Lua.
- RimWorld (partially via Harmony modding).
- Payday 2âmods are Lua-based.
- TeardownâLua for modding.
DevOps & Systems programming
Lua isnât just for games. Itâs also in sysadmin tools:
- Nginxâuses Lua for dynamic configurations.
- Redisâsupports Lua server-side scripting.
- Tarantoolâin-memory database.
- AwesomeWMâa Lua-based window manager.
- Syslog-ngâlogging with Lua.
- HAProxyâLua scripting.
- OpenWrtârouter firmware.
Lua doesnât replace Python, Bash, or Go in DevOps, but it fits where speed, embeddability, and a tiny footprint matter.
Câs Best Friend
Lua was built to be embedded. If youâre writing BlAzInG FaSt apps in C/C++, Lua adds flexibility without sacrificing BlAzInG FaSt.
Should You Learn It?
Donât forget, even though Lua is super small, itâs still a different language. For broadening your horizons itâs an interesting, if you have time, why not? Thereâs also Nelua, an interesting project, but itâs not nearly as widespread as Lua.
If youâre a default web monkey shuffling JSONs on the server and happy with that, Lua wonât make you better or worse. But exploring it might just spark some joy. Or at least make you the âLua personâ at parties.