Lua facts for kids
![]() |
|
Paradigm | Multi-paradigm: scripting, imperative (procedural, prototype-based, object-oriented), functional |
---|---|
Designed by | Roberto Ierusalimschy Waldemar Celes Luiz Henrique de Figueiredo |
First appeared | 1993 |
Stable release |
5.3.4 / January 30, 2017
|
Typing discipline | dynamic, strong, duck |
OS | Cross-platform |
License | MIT License |
Major implementations | |
Lua, LuaJIT, LLVM-Lua, Lua Alchemy | |
Dialects | |
Metalua, Idle, GSL Shell | |
Influenced by | |
C++, CLU, Modula, Scheme, SNOBOL | |
Influenced | |
Io, GameMonkey, Squirrel, Falcon, MiniD |
Lua is a special kind of programming language that is open source. This means anyone can use and change it for free! It was created in 1993 by three smart people: Roberto Ierusalimschy, Luiz Henrique de Figueiredo, and Waldemar Celes.
Lua is super useful for many things. It's especially popular in video games. You might have played games like World of Warcraft or SimCity 4 that use Lua. It's also a big part of Roblox, where people create their own virtual worlds.
In 2010, Apple Inc. made it easier to use Lua for making iPhone apps. This helped games like Angry Birds become popular. By 2011, Lua was one of the top ten most used programming languages in the world!
Seeing Lua in Action
Let's look at some simple examples of how Lua code works. These examples show how a computer follows instructions written in Lua.
Your First Lua Program
This is a classic "Hello World!" program. It's often the first program people learn to write. It simply tells the computer to show the words "Hello World!".
#!/usr/bin/lua
print("Hello World!")
The `print` command tells the computer to display whatever is inside the quotation marks.
Storing and Showing Information
You can also store information in a "variable." A variable is like a box where you can keep a value. Then, you can use that value later.
#!/usr/bin/lua
a = "Hello World!"
print(a)
In this example, we put the words "Hello World!" into a variable named `a`. Then, we tell the computer to `print` the value stored in `a`. The result is the same: "Hello World!" appears on the screen.