Re: YAML 2.0: drop arbitrary nodes to be used as keys
Osamu TAKEUCHI <[email protected]> Thu, 3 Mar 2016 02:55:49 +0900
| Newsgroups | gmane.text.yaml.general |
|---|---|
| Message-ID | <[email protected]> |
Dear Andray, > >In YAML 1.2, the spec says > > Please be aware that YAML 1.2 does not really exist. It is completely ignored by the industry. > Even though it was released many years ago there is still no parser which implements it. Don't forget that YAML 1.1 also says it represents any native data structure: >> 3.1.1. Represent >> >> YAML represents any native data structure using three node kinds: sequence - an ordered >> series of entries; mapping - an unordered association of unique keys to values; and scalar >> - any datum with opaque structure presentable as a series of Unicode characters. Combined, >> these primitives generate directed graph structures. These primitives were chosen because >> they are both powerful and familiar: the sequence corresponds to a Perl array and a Python >> list, the mapping corresponds to a Perl hash table and a Python dictionary. The scalar >> represents strings, integers, dates, and other atomic data types. >> >> Each YAML node requires, in addition to its kind and content, a tag specifying its data type. >> Type specifiers are either global URIs, or are local in scope to a single application. For >> example, an integer is represented in YAML with a scalar plus the global tag >> “tag:yaml.org,2002:int”. Similarly, an invoice object, particular to a given organization, >> could be represented as a mapping together with the local tag “!invoice”. This simple model >> can represent any data structure independent of programming language. > I only know 2 parsers which _partially_ implement YAML 1.2 I made C# library that can seamlessly serialize arbitrary C# objects into YAML 1.2. https://yamlserializer.codeplex.com/wikipage?title=YamlSerizlizer&referringTitle=Home Whichever 1.1 or 1.2, YAML suits very well for building such a library especially with a language with the reflection ability. As I wrote, if YAML 2.0 changes its purpose, people will keep using YAML 1.1 or 1.2 for serializing native objects. For data serialization, we may talk about YAML 1.3. ;) > >Could you point out the importance of inter-operability > >if I do not understand it correctly. > > I will try to define what is inter-operability for me (as a developer of a general purpose YAML parser) > > If I have YAML document I can give it to anybody else. > They apply their context, they parse it with their programming language. > And they do not come back to me saying that I must change my YAML because they cannot do anything. > The above is valid for XML or JSON, but completely invalid for YAML. Have you ever done with giving a YAML document to someone who can not read it unless they write a program to read it by themselves? In more practical use cases, people might want build some tools to read/write a YAML file that is created by some application they use. If their favorite language or library does not allow them to read or write it, they will just try with a different language or library, don't they? If a hash with complex keys are serialized in XML, it involves the same problem. The difference is that a XML parser does not try to build the native hash that is not supported by the language. You can write YAML library with any practical language in the same manner the XML parsers do. > SnakeYAML issues are full with complains that users cannot work with YAML produced by another parser. > Why a developer should explain to the community the deficiencies of the specification ? If someone has ever complained, that proves there is actually some application that uses the ability of YAML to store a hash with complex keys, isn't it? Anyway, are they really the deficiencies of the specification? Not the limitation of the library? I suppose if the limitation is well documented and/or some work around is provided, people will not complain. > If you produce and consume YAML yourself then it works. Is it what we want ? We are not satisfied only with it but why don't we want it? Osamu Takeuchi ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Yaml-core mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/yaml-core