Live data from Hacker News

JSON5 Data Interchange Format

json5.org

31–40 of 157 posts

Re: JSON5 Data Interchange Format

#31
post #22

I have to admit that I once used python repr() as a way to pass json data. It worked. I think.

I've heard horror stories from a friend who had to fix such code introduced by a contractor. Management didn't want to throw any of it awayz because they paid a lot of money to the contractor. Of course broke in a hard to debug fashion.

Re: JSON5 Data Interchange Format

#32

json-ld files (json line delimited, means one json object per line) are used extensively in data processing. A lot of processing of these json-ld files uses normal builtins instead of special libraries eg in python doing a for line in or a stream map and the standard json lib etc. From a glance at this spec, it seems that where an object ends is no longer something that the normal file processing most languages posse…

JSON-LD is JSON Linked Data.

What you describe seems to be called line-delimited JSON, LDJSON, NDJSON or JSONL.

https://en.wikipedia.org/wiki/JSON_streaming

Re: JSON5 Data Interchange Format

#35

> "Strings may be single quoted." What's the point? I cringe every time a project uses both double quote and single quote, a mix of semicolon and no semicolon and a mix of tabs and space, .... Which one to pick isn't relevant as soon as the code base is consistent

It allows you to put double quotes in the string without escaping them, which is pretty nice.

Re: JSON5 Data Interchange Format

#36
post #29
post #11

Earlier quoted context omitted.

Because: ‘I am “really” angry’ Is much nicer than: “I am \”really\” angry”

Json is not meant to be human readable or writeable.

All text based data formats are meant to be human readable and human writable, and humans read and write JSON all the time.

Re: JSON5 Data Interchange Format

#37
post #22

I have to admit that I once used python repr() as a way to pass json data. It worked. I think.

It will work only as long as the object(s) interpreted by repr are serialzable by JSON, which is not a sound approach, unless you write a any-type serializer.

Re: JSON5 Data Interchange Format

#38

> "Strings may be single quoted." What's the point? I cringe every time a project uses both double quote and single quote, a mix of semicolon and no semicolon and a mix of tabs and space, .... Which one to pick isn't relevant as soon as the code base is consistent

[deleted]
Post reply on HN