On Mar 21, 2011, at 5:57 PM, Kevin Downey wrote:

> On Mon, Mar 21, 2011 at 2:15 PM, James Reeves <jree...@weavejester.com> wrote:
>> On 21 March 2011 13:14, Chas Emerick <cemer...@snowtide.com> wrote:
>>> I think we're in violent agreement.  Here's a sample nREPL exchange from 
>>> https://github.com/clojure/tools.nrepl:
>> 
>> Ah, I did look through that REPL exchange, but I misunderstood the
>> syntax the first time I read it. I now realise that the integer at the
>> beginning of each exchange refers to the number of key/value pairs
>> being transferred.
>> 
>> This seems a little odd, as it's halfway between explicitly specifying
>> the size of the input (as in bencode or netstrings), and using an
>> explicit delimiter (as in Stomp or HTTP). I can't think of any
>> advantage to doing it this way, instead of using either a delimiter or
>> an initial byte-count.
> 
> and there are numerous disadvantages, including the inability to
> separate possibly blocking extraction of a single message from the
> byte-stream from parsing of a single message

Kevin was patient enough to explain his use case in irc to me, so I understand 
better what he's aiming for.

It seems to me that the protocol, as it sits, is probably the easiest possible 
thing to work with assuming you have character streams available (all 
implementations of which I'm familiar with provide a convenient read-line 
operation).  This makes sense, as such an idiom is what I was assuming as the 
best/simplest approach for a non-Clojure client implementation.

However, there appears to be complete unanimity that this is a 
less-than-optimal approach that will make life harder for some potential client 
implementers in some contexts.  So, I'm willing to change the wire protocol.

I'll read more about netstrings, bencode, and other schemes.  In the meantime, 
those who care should pipe up now as to their preferences and/or points of 
advice.  The only significant preferences I have at the moment are that:

1. The result must be UTF-8, through and through.
2. The result should be trivially implementable in e.g. 
Clojure/Python/Ruby/bash, given character streams/readers.
3. This be a productive exchange with a notable lack of bikeshedding. ;-)

- Chas

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to