> The best scripts simply extend the existing Redis vocabulary of small atomic data operations with the smallest bit of logic necessary.
Having used quite a bit of Lua (in Redis) I whole heartedly agree.
> The best scripts simply extend the existing Redis vocabulary of small atomic data operations with the smallest bit of logic necessary.
Having used quite a bit of Lua (in Redis) I whole heartedly agree.
Lua is a relatively modern script language. It has all the tools you need to create modular programs in whatever style you like. Imperative is easy, OO style nearly so (there are plenty of OO implementations to choose from), and there is even some support for functional programming.
The PUC-Rio (main) implementation has a fast bytecode interpreter, and LuaJIT is wicked fast compared to just about anything else.
People don't tend to write really huge applications in Lua, but that is more due to the lack of libraries rather than anything else.
We used it to write almost all the game-logic on a few titles. Ran great on all sorts of platforms(this was before LuaJIT). Coroutines are awesome for AI, lets you bundle in all sorts of implicit state easily and concisely.
I don't see that as a valid concern anymore. The main concerns are 1) size of script you can comprehend, debug, and maintain and 2) do the most with the fewest network/redis calls. If you're 200 line lua script replaces 5-10 individual redis calls, that's surely a win simply from the perspective of network latency and data locality.