Re: YAML 2.0: drop arbitrary nodes to be used as keys

Osamu TAKEUCHI <[email protected]> Wed, 2 Mar 2016 23:56:40 +0900
Newsgroups gmane.text.yaml.general
Message-ID <[email protected]>
Dear Andrey,

In YAML 1.2, the spec says "In contrast (to JASON), YAML’s
foremost design goals are human readability and support
for serializing arbitrary native data structures."

If YAML 2.0 ceases to be a native data serialization
language, people will just continue to use YAML 1.2 for
the purpose. Then, it is desirable to continue
maintaining YAML 1.2 in parallel with YAML 2.0.

Another point: it is repeatedly discussed in this list
that *inter-operability* across specific applications
is not so important. Every YAML file has its own purpose.
No one wants to pass a YAML file created by an application
to another application nothing to do with the original
one. Even if some YAML libraries do not understand
complex hash keys because the language do not natively
support such keys, nobody will be sad.

Could you point out the importance of inter-operability
if I do not understand it correctly.

> - the parser creates lists, not tuples (yes, including PyYAML)

A parser for the specific application can create tuples from
a sequence by an implicit tag resolution. In general, YAML
file with implicit tag resolution can not be interoperable
without the complete knowledge of the specific schema. And
nobody will suffer from this kind of non-inter-operability.

Best,

Osamu Takeuchi


On 2016/03/02 22:54, Andrey Somov wrote:
> The fact that tuples are supported by Python or Scala or anything else is not important:
>
> - the parser creates lists, not tuples (yes, including PyYAML)
> - do we care what JavaScript parser should do ? Or can just say "JavaScript suck" and ignore ?
> - collection as a key makes YAML unreadable
> - collections may have sub-collections and it may be endless
>
> For me the whole issue with YAML 2.0 is:
> - inter-operability
> - readability
> - simplicity (for users, not for parser developers)
>
>
> Those who who want to stick to one language may still use YAML 1.1.
>
> Andrey
>
>
> On Wed, Mar 2, 2016 at 1:50 PM, Roy Brokvam <[email protected] <mailto:[email protected]>> wrote:
>
>     Maps with tuple keys are supported and commonly used in many languages, it's not a Python specific thing.
>
>     The hard part isn't supporting collection-valued keys as such. The hard part is supporting *infinite* collection-valued keys, i.e. a collection which contains an alias to themselves or to a parent, or which contains an infinite element.
>
>     Supporting infinite collections as mapping keys seems unnecessary.
>
>
>     Roy Brokvam
>
>
>     Mvh / Kind regards
>
>     *Roy Brokvam*
>     Senior systemutvikler | Senior Developer
>     + 47 48 04 16 60 | [email protected] <mailto:[email protected]>
>
>     *Dossier Solution**s*
>     Rådhusgata 30 B | NO-0151 Oslo | +47 22 11 20 90 | www.dossier.no <http://www.dossier.no/>
>
>
>     Se video om hvordan Dossier sikrer høy medarbeideroppfølging <http://www.dossier.no/talent-management-video/>
>
>
>     2016-03-02 13:27 GMT+01:00 Andrey Somov <[email protected] <mailto:[email protected]>>:
>
>
>         >No. Tuples are immutables in Python, and can be used as keys in Python dictionaries.
>
>         This is exactly the message I would like to prevent.
>         (background - I used PyYAML a lot, as well as SnakeYAML)
>
>         The message: it must be in YAML because it is supported by _my_language_.
>         It means that YAML ends up with every dirty trick ever invented for any programming language. Do we want that ?
>         Do not we suffer now from the result of trying to put any hack to the specification (1:2 is integer !!!)?
>         Should we think about inter-operability ?
>
>         We should not implement things because it is possible, we should implements things which are useful.
>         If we take only one language (regardless which one), then I am off. (because then YAML is useless for me)
>
>         All the public YAML (which I know) does not use complex keys.
>         - ansible
>         - google engine
>         - testNG
>         - RAML
>         - polyglot Maven
>
>         Can anyone show an example of the public usage of YAML with  a complex key ?
>
>         Andrey
>
>
>
>
>
>         ------------------------------------------------------------------------------
>         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] <mailto:[email protected]>
>         https://lists.sourceforge.net/lists/listinfo/yaml-core
>
>
>
>
>
> ------------------------------------------------------------------------------
> 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
>


------------------------------------------------------------------------------
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