New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalize JSON5 #136
Comments
Great question! cc @jordanbtucker to chime in too. I think that's a reasonable goal. The reality is that we haven't shaken the boat with things like dates in all these years, so it's probably unlikely that we will at this point either. So there could be some value in officially and formally "freezing" the spec... but I think there's also something to be said for learning from people's experiences and adapting to an ever-changing world. How do others feel? |
Hey @aseemk, a few thoughts: (1) If you freeze JSON5 that doesn't mean in 5+ years from now the lessons from JSON5 can't be taken and developed into a new spec (JSON22?). JavaScript will continue to change slowly, and someday it might be good to have another spec for easy to write JSON to keep up with it. But I actually think that process will go better in some ways if the specs are separate! Otherwise you end up in a very awkward period where a program may accept Of course, this will end your ability to make small changes, which I admit is a real downside. (2) If you think it's a good idea to move towards freezing JSON5 then it doesn't have to happen immediately. For instance, @jordanbtucker's issues are exactly the kind of thing that would be good to resolve first. What do you think? |
@seagreen: That sounds like a good perspective to me. Thanks! 👍 |
@aseemk: It's been half a year since I opened this issue. Do you think it's time to move towards finishing this thing? If so we should start making a list of blockers. |
Bump. YAML is terrible, the world needs JSON5, to get adoption from serious users it has to actually be finished. |
For me comments, trailing commas and non-quoted key names is a must. Multiline stings with quoted ends are not convenient for copy/paste - Python-like triple quoted strings are better, but they lack indentation for readability. Everything else potentially makes parsing slower. Considering that JSON is cross-language, this - |
@techtonik: Gotchya. I actually have no opinion on any of the specifics. I really like the general direction of JSON5, so I trust that whatever changes are made in the run up to finalization will be as classy as the rest of the spec. The thing I do care about is that some kind of release does happen eventually. Even making a 1.x release and saying "nothing will change from this point except touchups" would go a long way, though of course I would prefer:
|
Comments alone are worthy of release - https://stackoverflow.com/questions/tagged/json?sort=votes |
Please see the v1.0.0 TODO list. If you are able to contribute to the spec, please do so on the beta branch. Beside completing the spec, I'm going to do a rewrite of the codebase because the current codebase is based on Crockford's implementation whereas the new codebase will be based on the ES5 implementation. |
Please see the v1.0.0 Milestone. Many of the issues/PRs will be fixed with the codebase rewrite, and I'll close those once I've merged that in, however, the CLI enhancements still need to be written along with their tests. |
v1.0.0-beta is live. Read the CHANGELOG to see the new features and fixes. Use it in your projects with: npm install --save json5@beta Use it in your terminal with: npm install -g json5@beta Use it in your browser with: <script src="https://unpkg.com/json5@beta/dist/index.js"></script> |
@jordanbtucker: Awesome! That was blazingly fast. Thank you for all your work on it. My only comment would be that I look forward to this TODO being filled out. I'm having trouble telling whether JSON5 is meant to be a superset of JSON or not. This comment makes me think not, but the ABNF makes me think it is. EDIT: I just want to say again how excited I am JSON5 is moving towards a 1.x release. This is seriously great. |
Amazing work @jordanbtucker!! :) |
@seagreen Thanks for the commendation. Here's the relevant section from the WIP spec regarding line and paragraph separators.
So officially, JSON5 is a strict superset of JSON and a loose subset of ES5 (but only loose regarding line and paragraph separators). I updated that comment to reflect this now. I haven't reviewed the ABNF with the new changes in mind, so I've added that to the TODO list. |
I forgot to document a new feature in the CHANGELOG.
This is mainly useful in two cases:
|
The latest draft of the spec is up at https://json5.github.io/json5-spec/. Make sure you refresh the page to get the latest version. The date should be September 28, 2017. I consider this the final version unless anyone finds anything wrong with it. Once finalized, it will say Standard instead of Draft, and the note about it being a draft will be removed. I appreciate any feedback. |
@jordanbtucker: This is excellent work!! Thank you as always. =) Minor bug: "A JSON5 parser transforms a JSON text into another representation" should be "JSON5 text", right? |
@aseemk Good catch. I fixed that, added a JSON5Punctuator production that I missed, made it mobile friendly, and added a server script for development. |
I've made several changes to the spec. Many of the changes are only formatting or rewording, but there are a few important changes.
That last change also required a bug fix committed in c952a0d and 78b403a, which is live on npm at |
A while ago, I ran the beta against the v0.5.1 test cases to make sure there were no regressions and fixed the bugs I found. Now, I've run v0.5.1 against the beta test cases to see if there were any changes I forgot to document. I found a few and updated the CHANGELOG. Here's a summary. (Subpoints are additional information not included in the CHANGELOG.)
|
Nice work! I raise both of my hands 🙌 — this is purposely a double-entendre. =) |
@jordanbtucker: This is amazingly fast progress. Also, thanks for the clarification that JSON5 is definitely a superset of JSON! My only concern is the clarity of this line:
It depends a lot on the precise meaning of "should" here. If I write a program that consumes JSON5 created by a generator, can I rely on those code points being escaped (AKA that the JSON5 will not actually be a superset of JSON, but rather an overlapping set?) You may define how you're using "should" somewhere else in the spec, if so sorry I missed it! |
Good question. The use of the word "should" has the same meaning as in RFC 2119.
So, no you should not rely on this behavior, especially since the JSON spec does not recommend that generators escape those characters and JSON5 parsers must be backward compatible with JSON. The old Bikeshed version of the spec referenced this RFC, but the Ecmarkup version doesn't. I'll be sure to add that reference back in. |
@jordanbtucker: Excellent😄 You've fully addressed all my concerns. |
I just updated the spec with a clause about the keywords and a few other fixes and clarifications. |
Apologies for the lack of updates lately. I've been busy with work and personal things. The reason I haven't released v1.0 yet is because I discovered a bug in the reference implementation, and I think it's important to release a working reference implementation along with the spec. I've already fixed the bug, so v1.0 of the spec and reference implementation should be ready to be released after the READMEs, and CHANGELOGs are updated. After v1.0 is released, I will continue work on refactoring |
Hello. Having no idea about the entire standardization process of the w3c and tc39 etc.. Is this issue the ticket for us, to make JSON5 an official supported standard? |
@MartinMuzatko At this point in time, there is no intention to make JSON5 a W3C or TC39 spec, and there isn't really a need to. The Source Maps spec is just a Google Doc, but it's in use by almost every modern transpilation software today, and I plan to implement it into JSON5 at some point too. As long as everyone agrees with the official JSON5 spec, it will be a standard regardless of whether it's endorsed by W3C or TC39. |
@jordanbtucker Endorsement by TC39/W3C may be helpful to avoid many branches such as JSON6, JSON7, etc 😁 |
v1.0.0 has landed. |
Fantastic work as always @jordanbtucker!! 😃 |
The EMCA JSON specification states, "Because it is so simple, it is not expected that the JSON grammar will ever change."
Will this ever be a goal of JSON5?
I really like what I see of the project so far. It seems like a perfect solution to JSON being hard to write. However, looking through the issue list I see things like variables and datetimes being discussed which make me nervous. Not that those things are bad, they just don't fit with my use case of only needing "writeable JSON".
The text was updated successfully, but these errors were encountered: