Re: [Json] On flat vs nested JSON encoding style

Anders Rundgren <> Sat, 06 February 2016 02:41 UTC

Return-Path: <>
Received: from localhost ( []) by (Postfix) with ESMTP id C0FBD1A88F0 for <>; Fri, 5 Feb 2016 18:41:38 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Status: No, score=-2 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, SPF_PASS=-0.001] autolearn=ham
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 8g8vcqi1xcG2 for <>; Fri, 5 Feb 2016 18:41:37 -0800 (PST)
Received: from ( [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id A3ADF1A88EB for <>; Fri, 5 Feb 2016 18:41:36 -0800 (PST)
Received: by with SMTP id p63so50330816wmp.1 for <>; Fri, 05 Feb 2016 18:41:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=aO+ysJPm3XhPDfjJGK94VfOPwiHNC2mu/CGEfYlfOx4=; b=Ay6alxMhUZVV5k414czccjZdeQRVQA7ErhJvtpEr8yoErXBnIYlfGRllsDy9a07BPC 1xLKuSyschzG3U7F99e8hVDDE4/lDNf4BVrO1fO3San7p5B5jkiP6qeVWn/RgNSqRkrt aqC6edgkZfE/55UukY8wF+bl/UmSd0jvA/kBiKGXOC47dsUJXL/N7baTCLgjfsRokxQ8 e0wdwv1zEyHlapXR8zuXvT7XVfNCLPYOAHuba0Mm27Fj6WkgNwD8bBtYtyYIFTFeHk81 oHk5a+jHShGMqFksPwnWhn02dW0zqpkPRoluEpnc+ZvZ4wCqfxQvu6sKmXqh++xilVGM nVCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=aO+ysJPm3XhPDfjJGK94VfOPwiHNC2mu/CGEfYlfOx4=; b=Gyk0Gt7AV4hHSQLr1wGv+d1K4y/SPdDllm0R1LeirChMUs8Oe/lyqSnEOsJqj87BQ1 0DVDkYmHInhuIHHaRk7Wv+vrLfLUr1yN1yO6XO12VOlMz4aeuY8T6WdZLRv6oeXJjFZw JlTktsYZxP6JDY9NxlF9cA3TDIJaZDGwmsw2Q+/vsBFmN7ysgdv5O16ZAB1ptPKh+KLx eiY+DMBBJW1Sq90hAcOvPGduwcuuASk7538gWbSujFL/jHS8+7KkcnhwE/s2a2r1fecn R9Uaa05SHpszryx4TPuwwCUILRFF8dmHn8h9XiYXPjOa4oRchXt+ce/tTzn72SxPbd4N pw1w==
X-Gm-Message-State: AG10YOQwbWvKte3ZYbC8DwWhUcYgf1Xg9j1s1jbWysebBWoCjnjddV7noJuVYJ3KFqBXaA==
X-Received: by with SMTP id ui4mr16465123wjc.177.1454726495272; Fri, 05 Feb 2016 18:41:35 -0800 (PST)
Received: from [] ( []) by with ESMTPSA id q75sm1210718wmd.6.2016. (version=TLSv1/SSLv3 cipher=OTHER); Fri, 05 Feb 2016 18:41:34 -0800 (PST)
To: Phillip Hallam-Baker <>
References: <> <> <> <> <> <> <> <> <> <> <>
From: Anders Rundgren <>
Message-ID: <>
Date: Sat, 6 Feb 2016 03:41:32 +0100
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Archived-At: <>
Cc: John Cowan <>, Carsten Bormann <>, Tim Bray <>, JSON WG <>
Subject: Re: [Json] On flat vs nested JSON encoding style
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: Sat, 06 Feb 2016 02:41:38 -0000

On 2016-02-05 17:27, Phillip Hallam-Baker wrote:
>> I fully buy into the efficiency aspect of the nested encoding style (which I
>> honestly had never thought of), but when it comes to "hard to follow",
>> predictable
>> serialization a la ES6 seems like a more universal solution since this also
>> sucks:
>>    {
>>       "city": "Paris",
>>       "name": "John Doe",
>>       "country": "FR",
>>       "zip": 245333
>>    }
>> ES6 serialization and the nested encoding style scheme can easily be
>> combined, hopefully bringing out the best of both worlds!
> There are probably valid use cases for a canonical serialization
> format. And that is probably more viable in JSON than in XML.

I have gradually lost faith in standardization as the best way forward
for stuff that is close to applications.  It takes too long time, and
there are usually multiple roads to (virtually) the same goal.  The IMO
worst thing is that WGs do not generally care about changes in the market,
or the availability of new technology although this could motivate charter
updates and sometimes even abandoning the work-item altogether.

And if you are Google you can do set standards for the rest of the world
which also makes standardization anything but a level playing field.

By building on a Google standard (V8) for JSON normalization (not canonicalization),
I feel quite safe that this concept (rather than my signature definition verbatim),
will become a de-facto standard.  That's perfectly satisfactory for my work which
simply is helping the payment industry converting to JSON.