JSON5 support for std.json

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 30 08:12:07 PST 2015


On Mon, 30 Nov 2015 03:40:12 +0000, Jack Stouffer wrote:

> On Monday, 30 November 2015 at 00:30:07 UTC, Chris Wright wrote:
>> I'm considering adding JSON5 support to std.json and want to know how
>> well this would be received.
> 
> Considering this is something that has apparently existed for more than
> three years and this is the first time I'm hearing of it, I have a hard
> time justifying it's inclusion into Phobos. I have never once heard of
> any project using JSON5 and googling it brings up one negative blog
> post, the HN post which is full of negative comments, and every other
> result are language bindings.
> 
> I have to agree with all the negativity, it seems like a poor idea and
> calling it "JSON" is inappropriate. Also, std.json is slated for
> deprecation.
> 
> If you want a JSON5 D parser, I'd say go ahead and throw it up on
> code.dlang.org. What would be much more beneficial IMO is a YAML parser
> based on the API of http://code.dlang.org/packages/std_data_json

JSON5 is pretty much just a codification of common relaxations to JSON 
parsers. For instance, a feature request for Newtonsoft JSON.NET (which 
is the most well known JSON library for .NET) to support JSON5 pretty 
much went "What's JSON5?" and then "Oh, we already support 90% of that".

The recent thread about DUB's config format would have been much more 
strongly in favor of JSON if std.json supported JSON5.

The reason to incorporate it into the standard library interpretation is 
because it's mostly identical to JSON, so sharing implementations is 
obvious.


More information about the Digitalmars-d mailing list