Question: what is _g in lua?
Answer: Lua keeps a distinguished environment called the global environment. This value is kept at a special index in the C registry. In Lua, the global variable _G is initialized with this same value. ( _G is never used internally.) When Lua loads a chunk, the default value for its _ENV upvalue is the global environment.