10 ms·
I use redis + lua quite a bit in my home-grown analytics real time tool. My biggest fear is when do I know I am overusing lua ? Is there a quantitative measure
by manishsharan 10y ago
I use redis + lua quite a bit in my home-grown analytics real time tool. My biggest fear is when do I know I am overusing lua ? Is there a quantitative measure for "smallest bit" of logic ? I fear I have been given a very long rope with Lua + Redis and I may be unknowingly about to hang myself.
- ansible 10y agoI don't understand what your concern is. 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.
- vvanders 10y ago> 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.
- marktangotango 10y ago> Is there a quantitative measure for "smallest bit" of logic ? 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.