-
Notifications
You must be signed in to change notification settings - Fork 23.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scripting with mruby #848
scripting with mruby #848
Conversation
- String - Integer - Array
exec: `make dep`
For more details, see `showcallinfo(mrb_state *mrb)` at `deps/mruby/tools/mruby/mruby.c`.
- Wrong number of args - Unknown command
- mruby true -> redis (integer) 1 - mruby false -> redis (nil) This spec is followed by `eval` command.
unhandled value should be returned nil
This is an awesome idea 👍 |
Hello, thanks for your great effort, but as repeated may times in the past, the scripting will be limited to a single language: Lua. Redis lua scripts are not at the level of complexity where really a language should be different from the other, given that we are talking of similar late-binding very dynamic languages. So adding support for other languages would result in zero practical improvement and great complexity added. Thanks anyway! |
* Add to JSONPath filter the regexp match operator * Improve coverage * Minor cosmetics * Allow match using regex pattern from a field and add end-to-end test * Test with numeric combined in filter * Add more tests and documentation
We have created a command
REVAL
to use mruby for scripting of Redis.mruby is the lightweight implementation of the Ruby language complying to (part of) the ISO standard.
Ruby is good at processing strings, arrays, hashes, etc. with its pretty designed libraries.
With mruby, we can do complex data operations in Redis with simple scripts.
How do you think about this idea?
As this patch is still rough cutting, some works will be needed to fit with Redis.
(For example
REVALSHA
is not implemented. Not implemented features are listed later.)If your feel positive about implementing scripting languages in Redis other than Lua, we would like to consider supporting JavaScript with v8.
JavaScript runs on both client-side and server-side.
If Redis supports JavaScript, we can write everything in JavaScript.
The usage of
REVAL
is as follows:Features
Run mruby in the context of Redis server.
Call Redis commands from a mruby script. (same as
EVAL
command)Conversion between mruby and Redis data types
Redis to mruby conversion table.
mruby to Redis conversion table.
(examples)
Not implemented yet
REVALSHA
REDIS.log