Re: YAML 1.2/1.* vs YAML 2.0

Zenaan Harkness <[email protected]> Thu, 3 Mar 2016 22:21:25 +0000
Newsgroups gmane.text.yaml.general
Message-ID <CAOsGNSSSssTq70OE5utfGdDgc5Av2weYNDS-3Ln89FGAXDfn_g@mail.gmail.com>
On 3/3/16, Oren Ben-Kiki <[email protected]> wrote:
> In 10 years, we basically didn't hear any request for truly new features,

YAML delivers on its original intention. I think it's great.

> which I take to mean that the basic design is good - especially the data
> model. I don't want to touch that part.

ACK. For 'forced' simplicity, surely JSON is your friend, although I
can appreciate the desire to simplify the parsers/ making parser
writers lives easier - anything that can help spread YAML is a good
thing.

> We did get a lot of complaints about the difficulty
> of parsing, and people just didn't use some of the
> stuff (folded blocks, %TAG, ...).

I use %TAG in every yaml file I've written so far (two small projects,
55 YAML files, ~8K YAML file lines). That said, I have considered, and
am still considering whether the strong typing this implies is better
avoided. I have not yet concluded on this.

Background:
I wrote my first version of a basic Java Bean serializer framework a
few years back, which is focused on maximizing the ease of human
editing of the YAML serialized format, for the purposes of also
creating ad hock beans by hand; I need to rewrite it (having only
begun to learn how to write such a thing) although I've been doing
"not computer" things in the intervening years; but I will get back to
rewriting it, and one day I hope it reaches something worthy to
release to the world; bold hopes, I'm a true believer in me etc. By
the way, I learned YAML on jvyamlb, have tried some other library, and
most recently settled on snakeyaml.

In my case, the following two lines are at the top of each YAML file:
%TAG ! !java/object:test.javabeans.
---

And this of course makes the rest of each YAML file "pleasant" for a
human (in this case me) to write. It has also facilitated more than
one relatively easy change to the package name for my sample javabeans
("test.javabeans."), although that's not a major issue for me either
way.

As has been said YAML 1.2 will of course continue to work (for those
needing "%TAG").

I have contemplated last year on not using TAG, and either implying
the type (package.prefix.BeanName), or using custom plain (string)
scalars to specify the type which is then determined programmatically
(above the YAML parser level). At the moment, I find TAG to be very
convenient for a human writing the YAML file. But again, I know I have
to rewrite the generator, and it has been a few years.

Perhaps in a couple of years I might be able to answer the question of
whether I consider TAG useful or not. I would really like to be able
to speak more definitively re TAG, but I'm pretty sure I'll need a
couple more years before I can do so. For now it's the only way I use
YAML ...

Regards,
Zenaan

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