Redis supports lua scripting. Using eval command, we can execute a lua script in redis. Is the lua script compiled or interpretted when redis calls a lua script?
Lua is not directly interpreted through a Lua file like other languages such as Python. Instead, it uses the Lua interpreter to compile a Lua file to bytecode. The Lua interpreter is written in ANSI C, making it highly portable and capable of running on a multitude of devices.
Presently, Redis supports a single scripting engine, the Lua 5.1 interpreter.
Lua is implemented in pure ANSI C and compiles unmodified in all known platforms. All you need to build Lua is an ANSI C compiler (gcc and clang are a popular ones). Lua also compiles cleanly as C++.
Lua scripts are executed atomically, that is, no other script or command will run while a script is running, which gives us the same transactional semantics as MULTI / EXEC .
Lua scripts sent to the Lua library for execution are always compiled to Lua VM instructions before execution. These instructions are then interpreted by the Lua VM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With