Re: [Json] Nudging the English-language vs. formalisms discussion forward

Phillip Hallam-Baker <> Thu, 20 February 2014 16:06 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id D35D11A01EF for <>; Thu, 20 Feb 2014 08:06:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id odBTIk9cr8wT for <>; Thu, 20 Feb 2014 08:06:30 -0800 (PST)
Received: from ( [IPv6:2a00:1450:4010:c03::22e]) by (Postfix) with ESMTP id 101B01A01DA for <>; Thu, 20 Feb 2014 08:06:29 -0800 (PST)
Received: by with SMTP id b8so1473970lan.19 for <>; Thu, 20 Feb 2014 08:06:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YzBMCZg9Cln0Fe9Gyzt8Lpa9jUNlHA5hToZ2cyezWgY=; b=kyOcSNXbEK28c9KFGvP/du1GeWtjaITwVhi2e1Ob+2wqwbTWNvKOcjxfK2r1L94tuu EM1OM9XVUPlwiGI3l5pfeiBK60hDTdjNwnWLz415EVRj6s/rpv5ycDGNRPpFBPcCSKke W3StKgW9PV/YpRBJAefHHWU46g75aPCPvsBxjW451TrqzlX1SYlnjmt/71yBupLMpGV5 dnjLBldDuK3T7Uoh86AGgXlgq5/Hs4+q6oGdLXp2RHcuJmVa1COSDvcEmF5HacmAnBsM MCcafRmhUDmSl+d4ikugu6MJya8HiamKwImCGjmsg8LmAFW1t06Nxlgc9/zOSi6URAEk Jj7A==
MIME-Version: 1.0
X-Received: by with SMTP id qt9mr1578460lbb.34.1392912385711; Thu, 20 Feb 2014 08:06:25 -0800 (PST)
Received: by with HTTP; Thu, 20 Feb 2014 08:06:25 -0800 (PST)
In-Reply-To: <AF211B67DB3D453D9DE8F8FA53886F73@codalogic>
References: <> <> <> <> <> <> <> <> <> <357740A8AA0F4316BE630917321FAB4D@codalogic> <B1EBE05A69362F001777F807@cyrus.local> <47BB9131737D42218A6382DEF45BBE2C@codalogic> <> <AF211B67DB3D453D9DE8F8FA53886F73@codalogic>
Date: Thu, 20 Feb 2014 11:06:25 -0500
Message-ID: <>
From: Phillip Hallam-Baker <>
To: Pete Cordell <>
Content-Type: multipart/alternative; boundary=089e01229710f4243804f2d8afe0
Cc: Cyrus Daboo <>, Carsten Bormann <>, JSON WG <>
Subject: Re: [Json] Nudging the English-language vs. formalisms discussion forward
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 20 Feb 2014 16:06:33 -0000


On Thu, Feb 20, 2014 at 10:22 AM, Pete Cordell <>wrote;wrote:

> ----- Original Message From: "Phillip Hallam-Baker"
>  IETF has not decided how to make JSON protocols composable.
> Isn't that why we're here?

It is why the group is here. But my point is that the group should decide
how to compose protocols and the people developing schemas should support
those tropes that are chosen.

So it is a separate problem. If people decide on how to do this, I will be
happy to extend my tool. But I don't think how this problem is solved
should be a way to decide between tools.

Yes, QNames are broken, so don't do that.  Think more packages in Java,
> namespaces in C#.  As simple as doing something like:
>    int port;
> contact;
> yields JSON of:
>    "port": 25, "contact": "...whatever..."
> We don't have to make things complicated!

That is a model that I could very easily support as my tool is written in
C#. In fact it already supports that kind of type label. All I would have
to do is add in 'Using' specifiers at the top.

The only thing it doesn't support are those semicolons. I find a carriage
return is enough.

Incidentally, this is what I meant when I said that discussion of the
schema ideas and merger might be more useful than more proposals.

> I disagree, I don't think the schema should address sub-syntax at all
>> except for a small number of encodings that are RFCs such as RFC3339
>> timestamps, URIs and DNS labels

> I disagree with this.  Dates alone illustrate that there are
> 'microformats' that can result in a much more compact, meaningful and
> useful format than say:
>    { "date": 25, "month": 12, "year": 2015, "hour": 12, "min": 0 }

But we already have an RFC for Date - RFC 3339. (Actually we have others
but we will forget those).

So this is one of the microformats that I define in the tool as intrinsic.
This also allows for the use of Integer encodings for DateTimes using
seconds since the start of some epoch.

> Another location format might be:
>    56°14'23.45"N,18°5'16.65"W

{ [56,14,23,45], [-18,-5,-16,-65]}

Forcing such formats to be JSONified may cause as much error as forcing
> IEEE 754 numbers to be decimalised.

It is certainly possible to do the job wrong but the above does not result
in any loss of precision.

The only case where I would feel comfortable with the microformat above is
if the protocol was interfacing to some application where that format was
already defined and translation between the formats would be needed.

So let's learn from the past and recognise that we can't build them all in
> upfront and design our format accordingly.

There may be a need for a microformat. But that should be rare and should
probably be specified in ABNF rather than the JSON schema.

In most real world examples you are going to get far more leverage by
>> sticking to only encoding in JSON data model and then finding an efficient
>> way to encode JSON rather than inventing ad-hoc microformats that are
>> neither JSON nor JSON data model, are going to require a custom parser and
>> are not going to compress.
> I'm not interested in compression beyond zip and co.  It may sound harsh
> of me, but my feeling is if this or the errors in floating point numbers is
> critical to you, then use something else.  We don't need something that is
> all things, to all people.

If someone is saying 'I only want text, space isn't important' then fine,
just use text.

But if someone is saying 'lets use JSON but then lets avoid making it too
verbose using these microformats to shave a few bytes' then I would much
prefer to just use an efficient encoding.

Unless dealing with text documents, LZ compression of an inefficient
encoding is not as effective as an efficient encoding in the first place.

If the threat of a binary encoding causes someone to withdraw an ad-hoc
microformat then its done its job...