Re: JSON as a subset of YAML, closing the last caveat
"Clark C. Evans" <[email protected]>
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
Michael, One of the biggest difficulties in modifying the specification and implementations is producing sufficient regression tests that cover all of the permutations of existing structures together with the proposed new structure. I think that if you worked through what you are actually proposing, with detailed test cases, this could grow some legs. I just don't have time to do this, and neither do Oren or Kirill. However, if you could work on updating a patch set to Krill's test suite (in the pyyaml subversion), it would greatly help move a proposal like this forward. Best, Clark On Tue, Aug 07, 2007 at 06:09:08PM -0700, Michael G Schwern wrote: | As most of you are probably aware, JSON is an accidental subset of YAML. | http://redhanded.hobix.com/inspect/yamlIsJson.html | | This is very handy to shut down YAML vs JSON format wars. Which should the | project accept? Use a YAML parser and accept both! | | But there's one important caveat: The comments. JSON comments (C++ style // | and /* */) are not valid YAML comments. Any JSON document must first be | stripped of its comments before it can be considered YAML. This is annoying. | It would be very nice to hang out a "We accept JSON and YAML" shingle with no | practical caveats. YAML can then strap itself onto JSON's popularity. | | Some might say "but comments are just presentation, they don't have any effect | on the data", and while that is true they are still useful, and people write | them and it remains an obstacle to JSON/YAML interchange. | | What's to be done? I see several levels. | | 1) Ignore it. | | 2) Individual YAML parser authors hack in support for JSON comments, | possibly with a switch to turn it on and off. | | 3) The YAML spec contains a suggestion that YAML parsers handle JSON | comments complete with a suggested grammar. | | 4) The YAML spec be amended to accept JSON single-line comments (//) which | are already very similar to YAML comments. | | 5) The YAML spec be amended to accept both JSON single and multi-line (/* */) | comments. | | Its such a small change to make YAML a complete superset of JSON, seems like | it would be worth it to take some action to close the gap. | | | (NOTE: to clarify I'm not saying to get rid of YAML's existing comments). | | | ------------------------------------------------------------------------- | This SF.net email is sponsored by: Splunk Inc. | Still grepping through log files to find problems? Stop. | Now Search log events and configuration files using AJAX and a browser. | Download your FREE copy of Splunk now >> http://get.splunk.com/ | _______________________________________________ | Yaml-core mailing list | [email protected] | https://lists.sourceforge.net/lists/listinfo/yaml-core | ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/