Remix.run Logo
stronglikedan 3 days ago

In the kitchen sink example (https://json5.org/), they say:

> "backwardsCompatible": "with JSON",

But in that same example, they have a comment like this:

> // comments

Wouldn't that make it not compatible with JSON?

crazygringo 3 days ago | parent | next [-]

It's confusing.

From what I understand, it's "backwards-compatible" with JSON because valid JSON is also valid JSON5.

But it's not "forwards-compatible" precisely because of comments etc.

metadat 2 days ago | parent [-]

Stating `backwards compatible` at a feature is at best confusing for readers who haven't already bought into JSON5 as "the way".

If people tended to interpret English correctly and not be susceptible to misinterpreting written statements, that would be nice. Reality is a bugger!

kiitos 2 days ago | parent | prev | next [-]

Backwards-compatible means the new thing can handle the old things. Here JSON5 is backwards-compatible with JSON.

Forwards-compatible means the old thing can handle the new things. Here JSON is not forwards-compatible with JSON5.

rapfaria 3 days ago | parent | prev | next [-]

Your existing JSON < 5 will work with json5, not the other way around

arvindh-manian 3 days ago | parent | prev [-]

It’s a superset of JSON. I guess they mean it’s backwards compatible in terms of reading existing JSONs?