Ok. There are two primary uses of YAML,
name: config file (human generated)
For configuration files, the application is well known,
and data is not usually 'transactional' further humans
are the editors.
Tags almost _never_ appear.
name: serialization (machine generated)
In this case, the application may not be known as well,
data is probably a document of one sort of another, and
humans may be reading it, but are not usually the authors.
Tags are common, if not frequent.
So, I have a proposal for YAML 1.1
Use of the !tag is a syntax error _unless_ a %YAML X.X
version number is present.
We allow for %YAML 1.0 directive (using the new syntax)
so that a 'patch' program can simply append '%YAML 1.0'
to the front of each file. In this case, the old tag
semantics are used.
Thoughts? This makes all of the existing Ruby and Python YAML 1.0
documents 'errors' in YAML 1.1, and allows for a very simple way to
'patch' them for use in a YAML 1.1 setting.
On Tue, Sep 14, 2004 at 12:49:31PM -0400, Clark C. Evans wrote:
| On Tue, Sep 14, 2004 at 01:00:18AM -0700, Brian Ingerson wrote:
| | There are early adopters, and I respect that. But I see YAML as still in
| | its infancy. There is only one really good implementation right now, the
| | Ruby one. And since we have Why's support to go ahead and do the right
| | thing, I am all for doing it.
| I gave this quite a bit of thought the last day, and I do admit
| that 80% of the tag use cases (between ! and !! excluding !handle!)
| will be local. Further, I do perfer moving in this direction,
| however, I'm not sure if it meets the test,
| It reduces the 'clutter' for 80% of the tag uses, for a
| document littered with tags, this is a significant savings.
| Brian says that !!private tags were never used, and the
| only ! tags were prefixed with perl/Package::Name. Brian
| stated that he will probably keep this style. Thus, there
| really isn't a problem for perl, backwards or forwards.
| PyYaml never really used !yaml types, and relied solely on
| !!private tags. Unfortunately, it didn't emit a %YAML
| directive, so it won't be easy to auto-detect older documents.
| The transition path is to _always_ serialize YAML documents
| with %YAML 1.1 for the short run, and assume !! means private
| tag unless the %YAML directive appears.
| Ruby appears to be in the same situation as Python, the
| %YAML tag was not explicit, and !! was used for private tags.
| I suppose the same transition path is needed.
| It may actually hurt YAML adoption if the common case always
| longer than necessary.
| I guess the important consideration is how large our user base
| has become. If we are under a few hundred, then perhaps it is
| worth the swap with a good transition plan. If we are in the
| thousands of users, well, it probably should stay as-is. ;(
| | To be honest I really don't anticipate a YAML 1.2. And we could still
| | call this one YAML 1.0 since we never froze the spec. But my gut is that
| | 1.1 is the right move.
| If we swap ! and !! there is no way it can remain YAML 1.0 as we
| have made the promise, even though the spec was not frozen, that
| it was only subject to 'tweaks'. Swapping ! and !! isn't a tweak.
| | As far as ! vs !! is concerned, I don't see it as a reversal per se. The
| | term "Private tags" means something totally different to me than it did
| | in YAML 1.0. I see now that private tags are the things that you are
| | using all the time when you mint your own types in private applications.
| Regardless, it is a significant burden for Python people and perhaps i
| Ruby people as well.
| | YAML types almost always have implicits, so it is very rare to use the
| | !!int. And !! is shouting that "I MEAN THE YAML INT, DAMMIT". Anyway I
| | feel very strongly to use this new meaning for 1.1.
| Ok. Then we _must_ carefully design a phase-in period.
| 1) If documents are explictly marked YAML 1.1 then ! is local,
| and !! is YAML. YAML processors will be enouraged to use
| the %YAML 1.1 directive to help reduce this sort of issue
| in the rare chance of future changes.
| 2) If unmarked, then !! is a warning for approximately a year or
| so (say 2005) when the warning will go away. The implementation
| will have to provide a flag to allow ! and !! to have %YAML 1.0
| Does the Perl printer agree to put out %YAML 1.1 in your
| serializations? Certainly hand-edited config files are a different
| issue; but these rarely use !tags.
| | I think that Oren's 4th survey item is very close to YAML 1.0 and makes
| | 23 and '23' different as they were before. But it keeps the plain scalar
| | flag out, which is cool. (Especially for Oren)
| This is fine. We need a bandaid, if you and Oren think this is
| the best alternative; then I'm perfectly happy.
| | All the other stuff below are big improvements. Go team.
| Nice. This means the original #11 proposal. The single ! has a
| 'magic' meaning per the 4th survey item, and the double !! is a
| syntax error.
| | If you look at the big picture through a fuzzy lens, the YAML spirit
| | hasn't changed one bit from 1.0 to 1.1. It's just gotten better. I don't
| | see anybody that we are truly screwing over with these things. So let's
| | move forward!
| Agreed. But, some groups of users will have to be careful, and
| others will experience some transition pain.
Clark C. Evans Prometheus Research, LLC.
o office: +1.203.777.2550
~/ , mobile: +1.203.444.0557
(( Prometheus Research: Transforming Data Into Knowledge
\/ - Research Exchange Database
/\ - Survey & Assessment Technologies
` \ - Software Tools for Researchers