by paulddraper · 3y ago · 0 comments
Not exactly sure why, but it really is.
Lua started out life as a simple language for extending larger projects and then repeatedly broke backwards compatibility to make the language simpler. For example it's lexically scoped now but it wasn't to begin with.
Contrast with python, which started out life as a simple beginner friendly language, then added lots of complexity, then had the totally botched transition from 2.7 to 3 and is now growing a static type system.
Lua is also very easy to embed in other systems. Like sqlite.c levels of easy to embed.
- easy to embed
- good ecosystem (in particular needed Lua GObject Introspection for pangocairo)
- usable from C (not just C++)
- not white space sensitive
- skills translate to programming in the large
- it's fast
A lot of games let you write little snippets of code or what have you in a console or text box. Python is really bad at handling that because of its whitespace sensitivity. It's also the slowest popular language by far.
It’s also hard to stop python code from doing things it really shouldn’t, like calling os._exit.
Oh, you also have to deal with linking against the right crt on windows.
1. Extremely permissive license.
2. Very simple embedding API.
3. Fairly efficient for a scripting language.
4. Simple and relatively easy to learn.