|
|
|
|
|
by CyberDildonics
2108 days ago
|
|
Lua is smaller, more consistent, and much more flexible with integration since it just C. Debugging is built into the language in a simple way. _G gets a table of all global variables debug.getlocal allows you get any and all variables at each stack frame at that point including name, value and type. You can even use debug.sethook to have a callback after every function, line, or instruction. On top of all that you have LuaJIT which not only runs ridiculously fast, but can deal with dynamically loaded files incredibly fast. It even has a direct foreign function interface and allows you to use shared libraries directly without writing any more C or recompiling them. |
|
The 'stock' Lua interpreter is very fast, very small (good for cache retention) and all its C functions are reentrant, so no global interpreter lock: those apply to both flavors.
As the tiniest of nitpicks, `_G` is the default home of the global environment, but it's just a variable. The correct way to get the environment is `getfenv(1)` or just `_ENV`, depending on your flavor.