Recs.
Updated
SpecsUpdate
Pros
Pro Overall language
Due to Lua's high performance (fast and small), it is used everywhere: backend application servers (NginX), smartphones (Android and iOS), IOT (embedded electronic devices), database engines (Redis), communication (WireShark). No other language can reach this. Learn Lua and you are ready to go everywhere.
Pro Fast
Lua's performance compares very well to other languages, If performance needs to be further improved you can:
- Implement critical parts in C
- Use the LuaJIT compiler. The LuaJIT compiler is a drop in replacement for the stock compiler and provides significant performance improvements. From the overview page:
LuaJIT speeds can rival code written in C.
Pro Clean and simple syntax suitable for beginners
The Lua syntax is modeled from Modula, a language known for being a fantastic introduction to programming.
The Lua syntax also has the following key characteristics:
Semicolon as a statement separator is optional (mostly used to resolve ambiguous cases as in a = f; (g).x(a)).
Syntactic sugar for function calls (f'string', f"string", f[[string]], and f{table}) and method calls (obj:m()).
Pro Very easy to integrate with C and C++
One of the best features of Lua is its very well designed C API. This is very useful if you have an existing C library you need to integrate with Lua or quickly get a Lua script running on the C side of the game.
Finally Lua plays so nice with C that if you need to optimise for speed you can re-write it in C a lot easier than other languages.
Cons
Con Easy to make mistakes when declaring variables
When writing a function, if a programmer forgets to declare a variable, that variable will be declared at global scope. The code will seem to run fine at first, but if another function uses a variable with the same name, but fails to declare it, it will create subtle, incredibly difficult to find bugs.