Lua for Beginners / Chapter 1 — The Shape of Lua (lessons 1–4) / Lesson 1

Implementations and Types (Install Lua and Meet the 8 Types)

Time needed: about 4 min (estimate)

☆ Read later

You can try the opening of this lesson without an account.

Lua is a language made to be embedded

Lua was designed less for building standalone apps and more to run inside other programs.

Its core is a small library written in C, and lots of software embeds it so that the inner logic can be written in Lua: Neovim configs, the LÖVE game framework, Redis scripts, and more.

The program doing the embedding is called the host.

Below, we asked the Lua inside Neovim and inside Redis to report its version, and both answered Lua 5.1.

Even though it's all Lua, the version and available functions differ from host to host.

Terminal (asking the Lua inside a host for its version)

$ nvim --headless -u NONE -c 'lua print(_VERSION, jit.version)' -c 'qa' Lua 5.1 LuaJIT 2.1.1788856981 $ redis-cli -p 16399 EVAL "return _VERSION" 0 "Lua 5.1"

Installing and checking the version

Create a free account to keep reading

With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.

Report a problem with this lesson

Log in to send a report.

Keyboard shortcuts

Keys available in a lesson
KeyAction
[ or Alt + ←Go to the previous lesson
] or Alt + →Go to the next lesson
?Open this list
EscClose this list

The keys do not work while the cursor is in a code editor or an input field.