<?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: Wishlist for JSON</title>
	<atom:link href="http://blog.reverberate.org/2007/06/28/wishlist-for-json/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.reverberate.org/2007/06/28/wishlist-for-json/</link>
	<description>parsing, performance, minimalism with C99</description>
	<lastBuildDate>Thu, 26 Jan 2012 04:15:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: josh</title>
		<link>http://blog.reverberate.org/2007/06/28/wishlist-for-json/comment-page-1/#comment-699</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Mon, 02 Jul 2007 17:41:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.reverberate.org/2007/06/28/wishlist-for-json/#comment-699</guid>
		<description>I see your point Matt, but if you make some smart choices I think the problem can be defined elegantly.

First things first: more complicated ideas like &quot;time of day&quot; or &quot;day of week&quot; definitely don&#039;t belong in JSON.  The simplest reason is that no date-related API I have ever encountered treats these as anything more complicated than an integer, which JSON already has.  Part of the beauty of JSON is that the types it contains map very nicely onto all sorts of type systems and standard libraries that have evolved organically over time.  No matter what language I&#039;m using, if I want to call a function that takes or returns  &quot;time of day&quot; or &quot;day of week&quot; value, it is almost invariably passed/returned as an integer.  So there&#039;s no sense in adding something like this to JSON, any more than adding a way to annotate a string to say &quot;this is a person&#039;s last name.&quot;

As far as calendars, time zones, leap seconds, and the like, I think a nice way to reconcile it all would be to introduce two different types: timestamp and date.

A timestamp would define a point in time, and be represented by unix epoch seconds.  Advantages: pretty much everyone uses it already, it can be extended arbitrarily both forwards and backwards by throwing more bits at the problem, can represent arbitrary precision using real numbers, programs have easy access to it through their existing standard libraries, and almost every date library ever invented can manipulate it natively.  Sure, it doesn&#039;t work for people who have super-specialized needs, but those people KNOW that time_t does&#039;t work for them.  :)

A timestamp would say nothing about calendar day, time zone, time of day, or anything like that.  It would be just a timestamp.

The other type could be a calendar day.  Year, month, day, that&#039;s it.  Although this is slightly ambiguous (since it doesn&#039;t specify the calendar), again I think we&#039;re talking about a situation where assuming it&#039;s gregorian will work for the vast, vast majority of applications.  And again, people for whom this doesn&#039;t work will definitely know who they are.

With these two types, I think you&#039;d have a generally useful solution that covers the vast majority of programmers&#039; needs, and that don&#039;t catch anyone off guard.</description>
		<content:encoded><![CDATA[<p>I see your point Matt, but if you make some smart choices I think the problem can be defined elegantly.</p>
<p>First things first: more complicated ideas like &#8220;time of day&#8221; or &#8220;day of week&#8221; definitely don&#8217;t belong in JSON.  The simplest reason is that no date-related API I have ever encountered treats these as anything more complicated than an integer, which JSON already has.  Part of the beauty of JSON is that the types it contains map very nicely onto all sorts of type systems and standard libraries that have evolved organically over time.  No matter what language I&#8217;m using, if I want to call a function that takes or returns  &#8220;time of day&#8221; or &#8220;day of week&#8221; value, it is almost invariably passed/returned as an integer.  So there&#8217;s no sense in adding something like this to JSON, any more than adding a way to annotate a string to say &#8220;this is a person&#8217;s last name.&#8221;</p>
<p>As far as calendars, time zones, leap seconds, and the like, I think a nice way to reconcile it all would be to introduce two different types: timestamp and date.</p>
<p>A timestamp would define a point in time, and be represented by unix epoch seconds.  Advantages: pretty much everyone uses it already, it can be extended arbitrarily both forwards and backwards by throwing more bits at the problem, can represent arbitrary precision using real numbers, programs have easy access to it through their existing standard libraries, and almost every date library ever invented can manipulate it natively.  Sure, it doesn&#8217;t work for people who have super-specialized needs, but those people KNOW that time_t does&#8217;t work for them.  <img src='http://blog.reverberate.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>A timestamp would say nothing about calendar day, time zone, time of day, or anything like that.  It would be just a timestamp.</p>
<p>The other type could be a calendar day.  Year, month, day, that&#8217;s it.  Although this is slightly ambiguous (since it doesn&#8217;t specify the calendar), again I think we&#8217;re talking about a situation where assuming it&#8217;s gregorian will work for the vast, vast majority of applications.  And again, people for whom this doesn&#8217;t work will definitely know who they are.</p>
<p>With these two types, I think you&#8217;d have a generally useful solution that covers the vast majority of programmers&#8217; needs, and that don&#8217;t catch anyone off guard.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Brubeck</title>
		<link>http://blog.reverberate.org/2007/06/28/wishlist-for-json/comment-page-1/#comment-692</link>
		<dc:creator>Matt Brubeck</dc:creator>
		<pubDate>Fri, 29 Jun 2007 19:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.reverberate.org/2007/06/28/wishlist-for-json/#comment-692</guid>
		<description>I&#039;m wary of dates, since they&#039;re not as self-describing as they look.  What calendar is it in?  What time zone?  With or without leap seconds?  How do you represent dates before 1 AD?  Dates and times have important semantics that aren&#039;t captured in naive representations.

&quot;@2007-06-28@&quot; may work for some limited cases, but to use it as a general format is asking for trouble (in the same way sending character data without a defined encoding is asking for trouble).  There are &lt;a href=&quot;http://tools.ietf.org/html/rfc3339&quot; rel=&quot;nofollow&quot;&gt;standard, unambiguous representations of dates&lt;/a&gt;, but they might not be as human-writeable as desired.

Also, different applications need different semantics from their date/time objects.  Some don&#039;t care about time zones; others do.  Some need &quot;time of day&quot; or &quot;day of week&quot; objects.  For many, date/time data is useless without being able to encode relative times and dates.  I&#039;m not sure any single interchange format can be useful in the real world while still remaining simple to write and parse.  (At least with character encoding, basically everyone can agree on UTF-8.)</description>
		<content:encoded><![CDATA[<p>I&#8217;m wary of dates, since they&#8217;re not as self-describing as they look.  What calendar is it in?  What time zone?  With or without leap seconds?  How do you represent dates before 1 AD?  Dates and times have important semantics that aren&#8217;t captured in naive representations.</p>
<p>&#8220;@2007-06-28@&#8221; may work for some limited cases, but to use it as a general format is asking for trouble (in the same way sending character data without a defined encoding is asking for trouble).  There are <a href="http://tools.ietf.org/html/rfc3339" rel="nofollow">standard, unambiguous representations of dates</a>, but they might not be as human-writeable as desired.</p>
<p>Also, different applications need different semantics from their date/time objects.  Some don&#8217;t care about time zones; others do.  Some need &#8220;time of day&#8221; or &#8220;day of week&#8221; objects.  For many, date/time data is useless without being able to encode relative times and dates.  I&#8217;m not sure any single interchange format can be useful in the real world while still remaining simple to write and parse.  (At least with character encoding, basically everyone can agree on UTF-8.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: josh</title>
		<link>http://blog.reverberate.org/2007/06/28/wishlist-for-json/comment-page-1/#comment-691</link>
		<dc:creator>josh</dc:creator>
		<pubDate>Fri, 29 Jun 2007 01:14:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.reverberate.org/2007/06/28/wishlist-for-json/#comment-691</guid>
		<description>I call JSON self-describing because the data alone gives you a complete description of its structure.  The data alone tells you whether you&#039;ve got an array of arrays of arrays or a hash mapping strings to booleans (or something else).

I don&#039;t think I understand what *you* mean by &quot;self-describing.&quot;</description>
		<content:encoded><![CDATA[<p>I call JSON self-describing because the data alone gives you a complete description of its structure.  The data alone tells you whether you&#8217;ve got an array of arrays of arrays or a hash mapping strings to booleans (or something else).</p>
<p>I don&#8217;t think I understand what *you* mean by &#8220;self-describing.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: buffalo</title>
		<link>http://blog.reverberate.org/2007/06/28/wishlist-for-json/comment-page-1/#comment-690</link>
		<dc:creator>buffalo</dc:creator>
		<pubDate>Fri, 29 Jun 2007 00:32:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.reverberate.org/2007/06/28/wishlist-for-json/#comment-690</guid>
		<description>Despite my usual unreasoning desire to disagree with Josh, JSON is so good that it&#039;s just hard to argue with.  Although it works a hellofalot better in languages where you can say &quot;give me a list or a hash or whatever you&#039;ve got there&quot;.

But what do you mean by &quot;self describing&quot;?  To me JSON is the canonical non-self describing language - all its structure is inferred in the spec and none of it comes from the data you&#039;re getting.</description>
		<content:encoded><![CDATA[<p>Despite my usual unreasoning desire to disagree with Josh, JSON is so good that it&#8217;s just hard to argue with.  Although it works a hellofalot better in languages where you can say &#8220;give me a list or a hash or whatever you&#8217;ve got there&#8221;.</p>
<p>But what do you mean by &#8220;self describing&#8221;?  To me JSON is the canonical non-self describing language &#8211; all its structure is inferred in the spec and none of it comes from the data you&#8217;re getting.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

