There is no real need to use the registry; if you are embedding Lua in
a main program, you can simply use the first few stack slots to store
whatever you like. Lua scripts cannot see these stack slots, so they
are completely safe. However, your C callbacks won't be able to see
them either, so if you are using C callbacks, you either have to use
the registry or you need to associate the script's package table
(assuming you have built one LTN-11 style) or environment table
(if you setfenv'd) with an upvalue in your C callbacks --
this is my preferred solution, and it is very little more
work than the registry solution. It works very nicely for
configuration tables, too.