← Back to Lua Course | Chapter 1: Introduction | Lesson 1 of 7

What is Lua

Lua is a small, fast scripting language that is easy to embed inside other programs such as games.

In this page:

  1. What is Lua

What is Lua

Lua is a lightweight, dynamically typed scripting language created in 1993 at PUC-Rio in Brazil. It is designed to be embedded in host applications written in C, and is widely used in game engines, tools and configuration. The interpreter is tiny and a Lua program is compiled to bytecode and run by a virtual machine.

Note: Lua has only a few core ideas, tables, functions and metatables, and everything else is built from them.

Example: What is Lua

lua
print("Hello from " .. _VERSION)
print("Lua is dynamically typed:", type(10), type("ten"), type(true))

-- Output:
-- Hello from Lua 5.3
-- Lua is dynamically typed:	number	string	boolean
Common Mistakes
  1. Thinking Lua stands for an acronym
  2. Expecting a huge standard library like Python has
  3. Assuming Lua only works inside games
Chapter Summary
  • Lua is a lightweight scripting language
  • It is designed to be embedded
  • Programs run on a bytecode virtual machine
  • Tables are its main data structure
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.