<!-- 
RSS generated by JIRA (4.4#649-r158309) at Thu May 23 19:06:35 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/NREPL-11/NREPL-11.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[NREPL-11] Ensure efficient bytestring (byte[]) support in bencode transport</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-11</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;In particular, no boxing of individual bytes or multiple en/decoding steps should be involved.&lt;/p&gt;

&lt;p&gt;This implies that:&lt;/p&gt;

&lt;p&gt;1. all string values should remain &lt;tt&gt;byte[]&lt;/tt&gt; coming out of the bencode protocol support (which makes it more compliant with bencode anyway)&lt;br/&gt;
2. the string decoding should occur in the bencode transport impl&lt;br/&gt;
3. all string values should be decoded, &lt;em&gt;except&lt;/em&gt; for those named in a reserved slot (say, &lt;tt&gt;&quot;-unencoded&quot;&lt;/tt&gt;)&lt;/p&gt;

&lt;p&gt;All map keys should always be decoded to Strings.&lt;/p&gt;

&lt;p&gt;While nREPL should continue to be fully compatible with Clojure 1.2.x, let&apos;s not kill ourselves trying to optimize for 1.2.x as well as Clojure &amp;gt;= 1.3.0; if necessary, just make sure the latter is fast.  If 1.2.x benefits as well, then good.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15240">NREPL-11</key>
            <summary>Ensure efficient bytestring (byte[]) support in bencode transport</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="cemerick">Chas Emerick</reporter>
                        <labels>
                    </labels>
                <created>Tue, 21 Feb 2012 19:33:08 -0600</created>
                <updated>Tue, 21 Aug 2012 20:26:25 -0500</updated>
                    <resolved>Tue, 21 Aug 2012 20:26:25 -0500</resolved>
                                            <fixVersion>0.2.0-beta9</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="27804" author="mbrandmeyer" created="Wed, 22 Feb 2012 14:05:29 -0600"  >&lt;p&gt;How about &#8220;&lt;tt&gt;nrepl/unencoded&lt;/tt&gt;&#8221; re point 3?&lt;/p&gt;</comment>
                    <comment id="27805" author="cemerick" created="Wed, 22 Feb 2012 17:57:01 -0600"  >&lt;p&gt;Is that intended to become a namespaced keyword at some point (further up in the stack than the bencode parser or transport, of course)?&lt;/p&gt;

&lt;p&gt;If so, does that imply that other keys (perhaps &quot;nonstandard&quot; ones defined by middlewares) should be namespaced as well?&lt;/p&gt;

&lt;p&gt;Also, this is actually impacting the protocol; &lt;tt&gt;nrepl/*&lt;/tt&gt; makes me think the slot is related to an &quot;application-level&quot; handler provided by nREPL.&lt;/p&gt;

&lt;p&gt;FWIW, my suggestion of &lt;tt&gt;-unencoded&lt;/tt&gt; was a nod to Python&apos;s &lt;tt&gt;_foo&lt;/tt&gt; and Clojure&apos;s &lt;tt&gt;-foo&lt;/tt&gt; to denote private / internal members. &amp;#42;shrug&amp;#42;&lt;/p&gt;</comment>
                    <comment id="27811" author="mbrandmeyer" created="Thu, 23 Feb 2012 05:03:05 -0600"  >&lt;p&gt;Namespaced keywords are indeed the inspiration. So that it should probably be more like &lt;tt&gt;clojure.tools.nrepl.transport/unencoded&lt;/tt&gt; rather than just &lt;tt&gt;nrepl/unencoded&lt;/tt&gt;. However it is not a requirement to be a real keyword. A qualified string works just as well. There could be a middleware which turns the map keys into keywords (considering also a possible namespace). ring has a similar middleware, IIRC. I think that qualified operation and result field values (in some form or the other) are a best practise in this respect.&lt;/p&gt;

&lt;p&gt;However your argument of &lt;tt&gt;unencoded&lt;/tt&gt; being part of the protocol is valid. But then why should it be private? Document it in the official protocol spec and let middlewares also add fields to it. The question is then: what happens with nested structures (eg. &lt;tt&gt;:status&lt;/tt&gt;, which has to be traversed now painfully)? If middlewares weren&apos;t allowed to add to it, then only &lt;tt&gt;:value&lt;/tt&gt; would be an interesting target for &lt;tt&gt;unencoded&lt;/tt&gt;. So a simple flag would suffice.&lt;/p&gt;

&lt;p&gt;In general, I still think a tagged protocol would have been the better solution since it also allows nesting and each slot knows whether it&apos;s encoded or not.&lt;/p&gt;

&lt;p&gt;Maybe we should clarify what middlewares are allowed to do. Is there already some documentation on this? (I&apos;m must confess I&apos;m not up-to-date with all the design changes.)&lt;/p&gt;</comment>
                    <comment id="27900" author="cemerick" created="Thu, 1 Mar 2012 15:32:33 -0600"  >&lt;p&gt;Re: encoding, I&apos;ve started to think perhaps nothing should be decoded by default, and middlewares can independently handle such things.  The standard middlewares will stake out one approach, but that at least leaves open the possibility of a different convention emerging over time that can be adopted later.&lt;/p&gt;

&lt;p&gt;Opinions?&lt;/p&gt;</comment>
                    <comment id="29234" author="cemerick" created="Mon, 20 Aug 2012 16:14:44 -0500"  >&lt;p&gt;Sorry, where is the code for this?  No .patch here, and nothing in bitbucket looks right.&lt;/p&gt;

&lt;p&gt;Leaving aside the code for now, defaulting to unencoded strings continues to seem reasonable; a default &lt;tt&gt;Transport&lt;/tt&gt; impl/substrate can perform the en/decoding, as well as establish a default convention for indicating that some fields values should be left unencoded and should not be decoded.&lt;/p&gt;</comment>
                    <comment id="29235" author="mbrandmeyer" created="Mon, 20 Aug 2012 16:21:28 -0500"  >&lt;p&gt;The code is here: &lt;a href=&quot;https://github.com/kotarak/tools.nrepl/tree/bencode-improvements2&quot;&gt;https://github.com/kotarak/tools.nrepl/tree/bencode-improvements2&lt;/a&gt;&lt;/p&gt;</comment>
                    <comment id="29237" author="cemerick" created="Mon, 20 Aug 2012 22:14:49 -0500"  >&lt;p&gt;Looks good, patch applied.&lt;/p&gt;

&lt;p&gt;I&apos;m less and less sure re: &lt;tt&gt;-unencoded&lt;/tt&gt;.  Thinking back to your &quot;tagged protocol&quot; comment, adopting a convention of keys like &lt;tt&gt;&quot;value/binary&quot;&lt;/tt&gt; (or something similar) would be quite a bit more flexible and somewhat simpler to handle.&lt;/p&gt;

&lt;p&gt;(Thinking of rich content, mime types could then be sent in e.g. &lt;tt&gt;&quot;value/mime&quot;&lt;/tt&gt; &#8212; not that the transport would care about that, but it would at least be easy to pair up data with its &quot;tag&quot;.)&lt;/p&gt;

&lt;p&gt;Thoughts?&lt;/p&gt;</comment>
                    <comment id="29248" author="cemerick" created="Tue, 21 Aug 2012 20:26:25 -0500"  >&lt;p&gt;Releasing -beta9 now; further discussion of unencoded value semantics can continue elsewhere&#8230;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>