> On Apr 10, 2017, at 6:37 AM, Dominique Devienne <[email protected]> wrote:
> 
> I ran into http://json5.org/ <http://json5.org/> which is an interesting 
> "for-humans" extension to JSON.

I love JSON5. It’s an extension of JSON that adds extra syntax from JavaScript, 
like single quotes, trailing commas, and unquoted alphanumeric keys. I find it 
much more readable and much easier to write. A key benefit is that, by using 
single quotes, you can embed JSON5 in a C/C++/Swift/etc. string literal without 
having to escape all those pesky double-quotes:

        const char *json  = "{\"foo\": \"bar\"}";
        const char *json5 = "{foo: 'bar'}";

FYI, I wrote a converter in C++ that translates JSON5 to JSON. I use it a lot 
in unit tests in my code. It's also useful when parsing configuration files 
that are likely to be human-written or -edited.
        https://github.com/couchbaselabs/fleece/blob/master/Fleece/JSON5.hh
        https://github.com/couchbaselabs/fleece/blob/master/Fleece/JSON5.cc

—Jens
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to