<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Prototype: EEP18 Considered Harmful: The problems with Erlang to JSON term translation</title>
	<atom:link href="http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation/feed/" rel="self" type="application/rss+xml" />
	<link>http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation/</link>
	<description>He just never stops talking</description>
	<lastBuildDate>Fri, 16 Dec 2011 00:30:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Chris Anderson</title>
		<link>http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation/comment-page-1/#comment-931</link>
		<dc:creator>Chris Anderson</dc:creator>
		<pubDate>Thu, 18 Dec 2008 01:19:05 +0000</pubDate>
		<guid isPermaLink="false">http://fullof.bs/?p=402#comment-931</guid>
		<description>In CouchDB it&#039;s the e2j(j2e(Json)) == Json we&#039;re interested in. We&#039;ve been using the EEP&#039;s mapping for a few months now, without trouble -- we&#039;re mostly excited about the possibility of native speed with a C implementation. JSON encoding and decoding is currently our biggest bottleneck.

From my perspective, JSON round-trip-ability is the main event. It makes more sense to me, to construct valid-as-JSON Erlang terms, and then convert them for external use.

This gives the advantage of the Erlang programmer having full control over the JSON output. (At the expensive of an automatic 2-way Erlang-&gt;JSON-&gt;Erlang serialization.)

Marshaling arbitrary Erlang terms could be done by serializing terms to lists and proplists suitable for 2-way-JSON transformation.

I don&#039;t feel qualified to speak about the naming issue, but there are enough experienced Erlangers behind the proposal to ease my mind.</description>
		<content:encoded><![CDATA[<p>In CouchDB it&#8217;s the e2j(j2e(Json)) == Json we&#8217;re interested in. We&#8217;ve been using the EEP&#8217;s mapping for a few months now, without trouble &#8212; we&#8217;re mostly excited about the possibility of native speed with a C implementation. JSON encoding and decoding is currently our biggest bottleneck.</p>
<p>From my perspective, JSON round-trip-ability is the main event. It makes more sense to me, to construct valid-as-JSON Erlang terms, and then convert them for external use.</p>
<p>This gives the advantage of the Erlang programmer having full control over the JSON output. (At the expensive of an automatic 2-way Erlang-&gt;JSON-&gt;Erlang serialization.)</p>
<p>Marshaling arbitrary Erlang terms could be done by serializing terms to lists and proplists suitable for 2-way-JSON transformation.</p>
<p>I don&#8217;t feel qualified to speak about the naming issue, but there are enough experienced Erlangers behind the proposal to ease my mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: D Smith</title>
		<link>http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation/comment-page-1/#comment-929</link>
		<dc:creator>D Smith</dc:creator>
		<pubDate>Tue, 09 Dec 2008 18:25:51 +0000</pubDate>
		<guid isPermaLink="false">http://fullof.bs/?p=402#comment-929</guid>
		<description>&gt; Not exactly even flat list:
&gt; 1&gt; binary_to_list(list_to_binary([255])).
&gt; “\377″
&gt; 2&gt; binary_to_list(list_to_binary([256])).
&gt; ** exception error: bad argument
&gt; in function list_to_binary/1
&gt; called as list_to_binary([256])


The \377 is replace in stream by your terminal. It looks like a four character list but it is a single element in the list with an integer value of 255.  Believe me it&#039;s just your terminal emulator playing with your mind.  Don&#039;t believe me!  Change the character encoding of your TE.</description>
		<content:encoded><![CDATA[<p>&gt; Not exactly even flat list:<br />
&gt; 1&gt; binary_to_list(list_to_binary([255])).<br />
&gt; “\377″<br />
&gt; 2&gt; binary_to_list(list_to_binary([256])).<br />
&gt; ** exception error: bad argument<br />
&gt; in function list_to_binary/1<br />
&gt; called as list_to_binary([256])</p>
<p>The \377 is replace in stream by your terminal. It looks like a four character list but it is a single element in the list with an integer value of 255.  Believe me it&#8217;s just your terminal emulator playing with your mind.  Don&#8217;t believe me!  Change the character encoding of your TE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hynek (Pichi) Vychodil</title>
		<link>http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation/comment-page-1/#comment-930</link>
		<dc:creator>Hynek (Pichi) Vychodil</dc:creator>
		<pubDate>Mon, 08 Dec 2008 17:42:29 +0000</pubDate>
		<guid isPermaLink="false">http://fullof.bs/?p=402#comment-930</guid>
		<description>Not exactly even flat list:
1&gt; binary_to_list(list_to_binary([255])).
&quot;\377&quot;
2&gt; binary_to_list(list_to_binary([256])).
** exception error: bad argument
     in function  list_to_binary/1
        called as list_to_binary([256])

First one show another problem. There is not only semantic same, but also source code form (&quot;[255]&quot; is not same as &quot;\&quot;\377\&quot;&quot;). If you understand JSON as code for JS semantic object, than you can achieve e2j(j2e(X))) == X in semantic manner but not in code. I think it is enough but should be well documented and frequently mentioned. Anyway, I agree with you, that EEP 18 is too much fresh and dangerous to implement as BIF in current state of art.</description>
		<content:encoded><![CDATA[<p>Not exactly even flat list:<br />
1&gt; binary_to_list(list_to_binary([255])).<br />
&#8220;\377&#8243;<br />
2&gt; binary_to_list(list_to_binary([256])).<br />
** exception error: bad argument<br />
     in function  list_to_binary/1<br />
        called as list_to_binary([256])</p>
<p>First one show another problem. There is not only semantic same, but also source code form (&#8220;[255]&#8221; is not same as &#8220;\&#8221;\377\&#8221;"). If you understand JSON as code for JS semantic object, than you can achieve e2j(j2e(X))) == X in semantic manner but not in code. I think it is enough but should be well documented and frequently mentioned. Anyway, I agree with you, that EEP 18 is too much fresh and dangerous to implement as BIF in current state of art.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Haugeland</title>
		<link>http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation/comment-page-1/#comment-928</link>
		<dc:creator>John Haugeland</dc:creator>
		<pubDate>Sun, 07 Dec 2008 16:40:42 +0000</pubDate>
		<guid isPermaLink="false">http://fullof.bs/?p=402#comment-928</guid>
		<description>I&#039;m not that worried about encoding all Erlang terms as JSON, I&#039;m just using that as an example of the flaws in the current EEP.

What I am worried about is representing every JSON term in Erlang unambiguously, and with the Unicode requirements of JSON, that isn&#039;t even possible in Erlang right now.

Above and beyond that, the only way to make strings unambiguous is to present them as binaries, and with Unicode&#039;s UTF8 requirements, that means using binaries to represent a varying width encoding, which is a performance nightmare in the making (especially for a language without meaningful manual iteration).

See also &lt;a href=&quot;http://sc.tri-bit.com/outgoing/scjson%20parser%20halp.html&quot; rel=&quot;nofollow&quot;&gt;this document&lt;/a&gt; that I&#039;m working on.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not that worried about encoding all Erlang terms as JSON, I&#8217;m just using that as an example of the flaws in the current EEP.</p>
<p>What I am worried about is representing every JSON term in Erlang unambiguously, and with the Unicode requirements of JSON, that isn&#8217;t even possible in Erlang right now.</p>
<p>Above and beyond that, the only way to make strings unambiguous is to present them as binaries, and with Unicode&#8217;s UTF8 requirements, that means using binaries to represent a varying width encoding, which is a performance nightmare in the making (especially for a language without meaningful manual iteration).</p>
<p>See also <a href="http://sc.tri-bit.com/outgoing/scjson%20parser%20halp.html" rel="nofollow">this document</a> that I&#8217;m working on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Per Gustafsson</title>
		<link>http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation/comment-page-1/#comment-927</link>
		<dc:creator>Per Gustafsson</dc:creator>
		<pubDate>Sun, 07 Dec 2008 16:27:48 +0000</pubDate>
		<guid isPermaLink="false">http://fullof.bs/?p=402#comment-927</guid>
		<description>&lt;cite&gt; foo_to_bar(X) bifs are currently never lossy

I do not think this is correct if you look at list_to_binary and binary_to_list you find that list_to_binary(binary_to_list(X)) == X holds, but binary_to_list(list_to_binary(X)) == X does not hold since X could have been a deep list.

This is minor point of course, but I don&#039;t understand why you would want to be able to encode any erlang term in JSON. I do not think that this is necessary since there are several Erlang values which makes no sense outside of Erlang e.g. ports and pids. I think it would be more reasonable to define a 1-1 mapping between all JSON terms and a subset of Erlang terms. Which seems to be what EEP 18 does.</description>
		<content:encoded><![CDATA[<p><cite> foo_to_bar(X) bifs are currently never lossy</p>
<p>I do not think this is correct if you look at list_to_binary and binary_to_list you find that list_to_binary(binary_to_list(X)) == X holds, but binary_to_list(list_to_binary(X)) == X does not hold since X could have been a deep list.</p>
<p>This is minor point of course, but I don&#8217;t understand why you would want to be able to encode any erlang term in JSON. I do not think that this is necessary since there are several Erlang values which makes no sense outside of Erlang e.g. ports and pids. I think it would be more reasonable to define a 1-1 mapping between all JSON terms and a subset of Erlang terms. Which seems to be what EEP 18 does.</cite></p>
]]></content:encoded>
	</item>
</channel>
</rss>

