3 ms·
LUA is essentially build as a plugin language. It's simple and well behaved, very easy to spawn when you need it and throw it away when you are done with it. It
by grumbel 4y ago
LUA is essentially build as a plugin language. It's simple and well behaved, very easy to spawn when you need it and throw it away when you are done with it. It can also be isolated, if you don't want to give people access to file-io functions for example, you just don't load them into the interpreter and everything works as expected.
Most other language are not like that, they rely on global state and want to take full control your program. The interpreter also tends to be full of functions you can't get rid of, so they are impossible to secure. Even simple things like spawning two independent interpreters are often not supported. A language like Python really wants you to extend Python with modules, not extend your program with Python.
Long story short, writing a Lua interpreter is just a couple of lines of code: https://www.lua.org/pil/24.1.html https://www.lua.org/pil/24.1.html