Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion 'Crazy' new commands idea.
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jak Sprats  
View profile  
 More options Oct 28 2010, 9:23 pm
From: Jak Sprats <jakspr...@gmail.com>
Date: Thu, 28 Oct 2010 18:23:18 -0700 (PDT)
Local: Thurs, Oct 28 2010 9:23 pm
Subject: Re: 'Crazy' new commands idea.
I see this all related to some other posts
"Lists of hashes" http://groups.google.com/group/redis-db/browse_thread/thread/2ea22f14...
"Pipe the results of a command as arguments to another"
http://groups.google.com/group/redis-db/browse_thread/thread/d7ec7df9...

How can we extend redis to do some new stuff w/o totally obfuscating
the syntax and language.

I am a fan of IF statements, they can minimise sequential request
steps from app-server to redis-server, which cause app-server threads
to block multiple times for a single frontend request.
I am not a fan of PROCEDUREs, these should be done app-server side,
IMO.

I am a bigger fan of what I call EVAL (what other people called
recursive redis- cant find post) where you can do the following:
./redis-cli HSET hash0 name "I AM HASH ZERO"
./redis-cli HSET hash1 name "I AM HASH ONE"
./redis-cli HSET hash2 name "I AM HASH TWO"
./redis-cli RPUSH hashlist hash0
./redis-cli RPUSH hashlist hash1
./redis-cli RPUSH hashlist hash2
./redis-cli HGET $(LINDEX hashlist 1) name -> "I AM HASH ONE"

What is cool about bash, is this actually works: (EVAL in bash)
./redis-cli HGET $(./redis-cli LINDEX hashlist 1) name
And this also illustrates why I am a fan of the IF statement, this
request requires two ./redis-cli processes, which are akin to two
sequential app-server to redis-server requests (i.e. lots of overhead,
waiting, blocking, etc...).

On Oct 28, 5:52 pm, qyloxe <qyl...@gmail.com> wrote:

> Surely it would be tempting to have embedded python or java or ruby
> BUT as I can see it, it's not that level of abstraction.
> Python, Java, Ruby are precompiled to bytecodes which runs on their
> own virtual machines.
> I consider Redis is a virtual machine, too, so it's one level below
> those languages.

> Redis does excellent job as a VM for data structures. It has
> atomicity, persistence, communication, and did I mention
> atomicity ;-)?
> On the other hand, data structures are static but algorithms don't, so
> with a little help from VM, we could open doors for many useful
> solutions.
> Consider Example 1 from my first post - currently it is difficult to
> write it correctly on the client. Moreover the code would look ugly,
> with all that synchronisation, barriers and even timeouts or clean-up
> background tasks. On the server - the code looks simple and
> beautiful ;-)

> On 29 Paź, 02:08, Josiah Carlson <josiah.carl...@gmail.com> wrote:

> > If you're going to have a programming language embedded in there, why
> > create a new one?  Why not use one that is designed to be embedded?

> >  - Josiah

> > On Thu, Oct 28, 2010 at 4:57 PM, qyloxe <qyl...@gmail.com> wrote:
> > > Dvir, it seems you missed the point.

> > > Please, write the Example 1 in the language of your choice and let it
> > > be short, correct, multi-process safe and without timeouts.
> > > I dare you, it won't be a "dead simple" code ;-)

> > > On 29 Paź, 01:10, Dvir Volk <dvir...@gmail.com> wrote:
> > >> Personally I really don't like this direction. What's best about redis
> > >> is how dead simple it is, which keeps it easy to work with, and
> > >> performing amazingly.
> > >> If you want stored procedures you have traditional RDBMS for that. For
> > >> me as a (happy) user, this looks like going against the core values
> > >> and philosophy of redis.

> > >> On Fri, Oct 29, 2010 at 12:46 AM, Xiangrong Fang <xrf...@gmail.com> wrote:
> > >> > This is the idea of server-side-scripting, or macro commands. I like it.

> > >> > 2010/10/29 qyloxe <qyl...@gmail.com>:
> > >> >> Some 'crazy' ideas. New commands in capital letters:

> > >> >> Conditionals:

> > >> >> IF operand_type_1 operand_1 operator operand_type_2 operand_2
> > >> >> THEN
> > >> >>   block
> > >> >> ELSE
> > >> >>   block

> > >> >> operand_type_1,operand_type_2 -> ["key","value","list"...]
> > >> >> operator -> ["=",">","<",">=","<=","<>","!=","in","not in",...]

> > >> >> block -> single command or:

> > >> >> BEGIN
> > >> >>   command
> > >> >>   command
> > >> >>   command
> > >> >>   ...
> > >> >> END

> > >> >> BEGINPROCEDURE proc_name args
> > >> >> ENDPROCEDURE

> > >> >> CALL proc_name args

> > >> >> ====================
> > >> >> Example 1:

> > >> >> IF key mykey1 = value "xx"
> > >> >> THEN
> > >> >> BEGIN
> > >> >>   SET mykey2 "yy"
> > >> >>   INCR mykey3
> > >> >> END
> > >> >> ELSE
> > >> >> BEGIN
> > >> >>   SET mykey2 "zz"
> > >> >>   DECR mykey3
> > >> >> END

> > >> >> ====================
> > >> >> Example 2:

> > >> >> BEGINPROCEDURE myswap key1 key2
> > >> >>   SET myswap_temp key1
> > >> >>   SET key1 key2
> > >> >>   SET key2 myswap_temp
> > >> >>   INCR myswap_cnt
> > >> >> ENDPROCEDURE

> > >> >> CALL myswap mykey1 mykey2
> > >> >> CALL myswap mykey2 mykey3

> > >> >> ==============================

> > >> >> REDIS as a virtual machine - wow!

> > >> >> What you think?

> > >> >> --
> > >> >> You received this message because you are subscribed to the Google Groups "Redis DB" group.
> > >> >> To post to this group, send email to redis-db@googlegroups.com.
> > >> >> To unsubscribe from this group, send email to redis-db+unsubscribe@googlegroups.com.
> > >> >> For more options, visit this group athttp://groups.google.com/group/redis-db?hl=en.

> > >> > --
> > >> > You received this message because you are subscribed to the Google Groups "Redis DB" group.
> > >> > To post to this group, send email to redis-db@googlegroups.com.
> > >> > To unsubscribe from this group, send email to redis-db+unsubscribe@googlegroups.com.
> > >> > For more options, visit this group athttp://groups.google.com/group/redis-db?hl=en.

> > > --
> > > You received this message because you are subscribed to the Google Groups "Redis DB" group.
> > > To post to this group, send email to redis-db@googlegroups.com.
> > > To unsubscribe from this group, send email to redis-db+unsubscribe@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/redis-db?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.