d3x0r / JSON6

JSON for Humans (ES6)
Other
237 stars 15 forks source link

Hi...is this a thing? #1

Open rchrdnsh opened 7 years ago

rchrdnsh commented 7 years ago

Due to recent issues and frustrations in web app development I recently stumbled across this repo and am quite excited by it...it seems a little un-loved, however, so I'm curious if it's under active development or what it's future might be...anyways, just curoous :-)

d3x0r commented 7 years ago

I'm here; I haven't noticed any issues with it; it's certainly loved; but it's a rather monogamous relationship right now :)

d3x0r commented 7 years ago

I did use it in gun-file https://www.npmjs.com/package/gun-file for streaming large json data in... it's worked for a while now

rchrdnsh commented 7 years ago

well, that's great to hear, indeed...I hope this idea can be adopted on a larger and more impactful scale, so us humans can write JSON without pulling out our hair!

d3x0r commented 7 years ago

I suggested it on es-discuss... they were very resistant to changing/improving json even on the reading side. json5 was also resistant to improving their standards to include undefined, underscores, and uhmm somethinging else... so I ended up forking it. Json5.org has a bigger community; but it's half the speed of this.

stevage commented 7 years ago

Is there actually any difference between JSON5 and JSON6? Maybe those differececs could be documented...

d3x0r commented 7 years ago

Good idea to mark the differences.... https://github.com/d3x0r/JSON6#summary-of-changes-from-json5

Keyword undefined Objects/Strings back-tick quoted strings (no template support, just quotes) Strings - generous multiline string definition Numbers - underscore digit separation in numbers Arrays - empty members Streaming object interface.

https://github.com/d3x0r/JSON6#json6-streaming

And benchmarks...

This is nearly double the speed of [JSON5 http://json5.org] implementation that inspired this (which is half the speed of Crockford's reference implementation).

stevage commented 7 years ago

Hmm, some of those, like the underscore digit separation, seem a bit arbitrary, and not related to ES2015. One of the things I liked about JSON5, compared to HJSON, was that it was fairly restrained in the flexibility it allowed, and had a strong rationale for it. This seems a bit more towards the "anything goes as long as we can possibly parse it" end of the spectrum.

d3x0r commented 7 years ago

Underscores was inspired by https://mail.mozilla.org/pipermail/es-discuss/2017-July/048665.html https://github.com/tc39/proposal-numeric-separator the proposal has a list of other languages that support such a feature.

jdalton commented 6 years ago

This question issue looks to be resolved. Can it be closed?

glen-84 commented 6 years ago

I tried to suggest something similar to Douglas Crockford, but he didn't reply to my email. 😞