The example you cited just looks like an awfully convoluted way to recreate HINCRBY. Obviously there are much more powerful things that you could do with scripting, but this example makes me wonder if all those H-commands might be replaced with JSON & scripting (or handled internally by JSON & scripting) some time in the future.
Well it's not really HINCRBY, it increments a field of a JSON object that is otherwise not supported by Redis natively. It was just an example, but it is not a strange one, because there are many users with JSON objects, and similarly there are many users with specific needs: Do this if there is that in the key, add this element only if the list is < N elements, and so forth. With Lua scripting you can model all this without back-and-forth without the client and server, in other words, with 1/100 of the latency (or less).
Given that we'll implement new commands only when they are "fundamental" operatons. For instance there is some plan to implement list splicing. When this happens it's worth to write it in C for max performances, so I think we'll unlikely write parts of Redis in Lua itself. Scripting systems is something I love (see Emacs for instance) but IMHO Redis is the instance of system where this does not work: space and time are too important for Redis.
Thanks for the clarification. It's great to hear that scripting will reduce the need to create new commands. I'm sure some people have been getting slightly annoyed with the rapid proliferation of Redis commands, which already number well over 100. Can't remember them all!
"rapid proliferation of Redis commands"? If the total is indeed, well over 100, that figure is spread among completely different data structures--lists, hashes, strings, sets, sorted sets--so i'm not sure it's even meaningful to compare the number of commands in redis with the number in some other DB which is based on a single data structure. Also, the increase in the number of commands might indeed just most reflect the incremental addition of new data structures to redis since its beginning (just strings, i believe).
That reminds me, I'd really like to see an official wiki (or just a simple pastebin-like thing like the Flask snippets site) for Redis scripts, use cases, best practices...
I've seen quite a few blog posts that highlight some amazing way to use Redis and it would be very helpful to have them all in one place.