The idea is great, it can speed up the running speed of the code, but this limits the freedom of the code and restricts the modification of variables in the running phase.
The type of constants in Lua can only be boolean, number, string now.
It looks good If it can support more types.
My suggestion is that if it assigns a global var to a const local var,
the var is evaluated during the loading stage rather than running.
Idioms like :
local print <const> = print
function foobar()
print "Hello World"
end
The local print can be a light C function constant. It can reduce the
memory footprint (fewer upvalues) and may faster. And it's more
friendly to the JIT or AOT compiler.
--
http://blog.codingnow.com