Is Lua compiled or interpreted?

Lua is compiled to bytecode, and a small virtual machine runs the bytecode. Standard Lua has no JIT. LuaJIT, a separate implementation, does.

How it runs your code

Lua compiles source code to bytecode when it loads a script, and its register-based virtual machine runs the bytecode. The standard implementation is small and does little optimizing. LuaJIT compiles hot code to machine code and runs many programs several times faster, which shows again that speed belongs to the implementation and not to the language.

Does that make Lua slow?

We have not measured Lua on this site. The pattern matches Python and Ruby: with no JIT, the virtual machine steps through bytecode, and an implementation with a JIT removes most of that cost.

Questions

Is Lua interpreted?

Standard Lua compiles to bytecode and runs it on a virtual machine. It does not execute source text directly.

Does Lua have a JIT?

Standard Lua does not. LuaJIT does.

Why is LuaJIT faster than Lua?

LuaJIT compiles hot code to machine code while the program runs. Standard Lua keeps stepping through bytecode.

Related

Is Python compiled? · Is Ruby compiled? · Is Perl compiled? · Compiled vs interpreted · Why optimization decides speed