<s>
YAML	B-Protocol
(	O
)	O
(	O
see	O
)	O
is	O
a	O
human-readable	B-General_Concept
data-serialization	B-Application
language	I-Application
.	O
</s>
<s>
It	O
is	O
commonly	O
used	O
for	O
configuration	B-Protocol
files	I-Protocol
and	O
in	O
applications	O
where	O
data	O
is	O
being	O
stored	O
or	O
transmitted	O
.	O
</s>
<s>
YAML	B-Protocol
targets	O
many	O
of	O
the	O
same	O
communications	O
applications	O
as	O
Extensible	B-Protocol
Markup	I-Protocol
Language	I-Protocol
(	O
XML	B-Protocol
)	O
but	O
has	O
a	O
minimal	O
syntax	O
which	O
intentionally	O
differs	O
from	O
Standard	B-Language
Generalized	I-Language
Markup	I-Language
Language	I-Language
(	O
SGML	B-Language
)	O
.	O
</s>
<s>
It	O
uses	O
both	O
Python-style	O
indentation	O
to	O
indicate	O
nesting	O
,	O
and	O
a	O
more	O
compact	O
format	O
that	O
uses	O
for	O
lists	O
and	O
for	O
maps	O
but	O
forbids	O
tab	O
characters	O
to	O
use	O
as	O
indentation	O
thus	O
only	O
some	O
JSON	B-General_Concept
files	O
are	O
valid	O
YAML	B-Protocol
1.2	O
.	O
</s>
<s>
Custom	O
data	O
types	O
are	O
allowed	O
,	O
but	O
YAML	B-Protocol
natively	O
encodes	O
scalars	O
(	O
such	O
as	O
strings	O
,	O
integers	O
,	O
and	O
floats	B-Algorithm
)	O
,	O
lists	O
,	O
and	O
associative	B-Application
arrays	I-Application
(	O
also	O
known	O
as	O
maps	O
,	O
dictionaries	B-Application
or	O
hashes	O
)	O
.	O
</s>
<s>
These	O
data	O
types	O
are	O
based	O
on	O
the	O
Perl	B-Language
programming	I-Language
language	I-Language
,	O
though	O
all	O
commonly	O
used	O
high-level	O
programming	O
languages	O
share	O
very	O
similar	O
concepts	O
.	O
</s>
<s>
The	O
colon-centered	O
syntax	O
,	O
used	O
for	O
expressing	O
key-value	B-Application
pairs	I-Application
,	O
is	O
inspired	O
by	O
electronic	O
mail	O
headers	O
as	O
defined	O
in	O
,	O
and	O
the	O
document	B-Algorithm
separator	I-Algorithm
is	O
borrowed	O
from	O
MIME	B-Protocol
(	O
)	O
.	O
</s>
<s>
Escape	O
sequences	O
are	O
reused	O
from	O
C	B-Language
,	O
and	O
whitespace	O
wrapping	O
for	O
multi-line	O
strings	O
is	O
inspired	O
by	O
HTML	B-Language
.	O
</s>
<s>
Lists	O
and	O
hashes	O
can	O
contain	O
nested	O
lists	O
and	O
hashes	O
,	O
forming	O
a	O
tree	B-Data_Structure
structure	I-Data_Structure
;	O
arbitrary	O
graphs	B-Application
can	O
be	O
represented	O
using	O
YAML	B-Protocol
aliases	O
(	O
similar	O
to	O
XML	B-Protocol
in	O
SOAP	B-Application
)	O
.	O
</s>
<s>
YAML	B-Protocol
is	O
intended	O
to	O
be	O
read	O
and	O
written	O
in	O
streams	O
,	O
a	O
feature	O
inspired	O
by	O
SAX	B-Application
.	O
</s>
<s>
Support	O
for	O
reading	O
and	O
writing	O
YAML	B-Protocol
is	O
available	O
for	O
many	O
programming	O
languages	O
.	O
</s>
<s>
Some	O
source-code	O
editors	O
such	O
as	O
Vim	B-Application
,	O
Emacs	B-Application
,	O
and	O
various	O
integrated	B-Application
development	I-Application
environments	I-Application
have	O
features	O
that	O
make	O
editing	O
YAML	B-Protocol
easier	O
,	O
such	O
as	O
folding	O
up	O
nested	O
structures	O
or	O
automatically	O
highlighting	O
syntax	O
errors	O
.	O
</s>
<s>
The	O
official	O
recommended	O
filename	O
extension	O
for	O
YAML	B-Protocol
files	O
has	O
been	O
since	O
2006	O
.	O
</s>
<s>
YAML	B-Protocol
(	O
,	O
rhymes	O
with	O
camel	O
)	O
was	O
first	O
proposed	O
by	O
Clark	B-Protocol
Evans	I-Protocol
in	O
2001	O
,	O
who	O
designed	O
it	O
together	O
with	O
Ingy	O
döt	O
Net	O
and	O
Oren	O
Ben-Kiki	O
.	O
</s>
<s>
Originally	O
YAML	B-Protocol
was	O
said	O
to	O
mean	O
Yet	B-Protocol
Another	I-Protocol
Markup	I-Protocol
Language	I-Protocol
,	O
because	O
it	O
was	O
released	O
in	O
an	O
era	O
that	O
saw	O
a	O
proliferation	O
of	O
markup	O
languages	O
for	O
presentation	O
and	O
connectivity	O
(	O
HTML	B-Language
,	O
XML	B-Protocol
,	O
SGML	B-Language
,	O
etc	O
)	O
.	O
</s>
<s>
Its	O
initial	O
name	O
was	O
intended	O
as	O
a	O
tongue-in-cheek	O
reference	O
to	O
the	O
technology	O
landscape	O
,	O
referencing	O
its	O
purpose	O
as	O
a	O
markup	O
language	O
with	O
the	O
yet	O
another	O
construct	O
,	O
but	O
it	O
was	O
then	O
repurposed	O
as	O
YAML	B-Protocol
Ai	I-Protocol
n't	I-Protocol
Markup	I-Protocol
Language	I-Protocol
,	O
a	O
recursive	O
acronym	O
,	O
to	O
distinguish	O
its	O
purpose	O
as	O
data-oriented	O
,	O
rather	O
than	O
document	O
markup	O
.	O
</s>
<s>
YAML	B-Protocol
accepts	O
the	O
entire	O
Unicode	O
character	O
set	O
,	O
except	O
for	O
some	O
control	O
characters	O
,	O
and	O
may	O
be	O
encoded	O
in	O
any	O
one	O
of	O
UTF-8	O
,	O
UTF-16	O
or	O
UTF-32	O
.	O
</s>
<s>
(	O
Though	O
UTF-32	O
is	O
not	O
mandatory	O
,	O
it	O
is	O
required	O
for	O
a	O
parser	O
to	O
have	O
JSON	B-General_Concept
compatibility	O
.	O
)	O
</s>
<s>
An	O
associative	B-Application
array	I-Application
entry	O
is	O
represented	O
using	O
colon	O
space	O
in	O
the	O
form	O
key	O
:	O
value	O
with	O
one	O
entry	O
per	O
line	O
.	O
</s>
<s>
YAML	B-Protocol
requires	O
the	O
colon	O
be	O
followed	O
by	O
a	O
space	O
so	O
that	O
url-style	O
strings	O
like	O
can	O
be	O
represented	O
without	O
needing	O
to	O
be	O
enclosed	O
in	O
quotes	O
.	O
</s>
<s>
An	O
associative	B-Application
array	I-Application
can	O
also	O
be	O
specified	O
by	O
text	O
enclosed	O
in	O
curly	O
braces	O
(	O
)	O
,	O
with	O
keys	O
separated	O
from	O
values	O
by	O
colon	O
and	O
the	O
entries	O
separated	O
by	O
commas	O
(	O
spaces	O
are	O
not	O
required	O
to	O
retain	O
compatibility	O
with	O
JSON	B-General_Concept
)	O
.	O
</s>
<s>
Strings	O
(	O
one	O
type	O
of	O
scalar	O
in	O
YAML	B-Protocol
)	O
are	O
ordinarily	O
unquoted	O
,	O
but	O
may	O
be	O
enclosed	O
in	O
double-quotes	O
(	O
)	O
,	O
or	O
single-quotes	O
(	O
)	O
.	O
</s>
<s>
Within	O
double-quotes	O
,	O
special	O
characters	O
may	O
be	O
represented	O
with	O
C-style	B-Language
escape	O
sequences	O
starting	O
with	O
a	O
backslash	O
(	O
)	O
.	O
</s>
<s>
Block	O
scalars	O
are	O
delimited	B-Algorithm
with	O
indentation	O
with	O
optional	O
modifiers	O
to	O
preserve	O
( |	O
)	O
or	O
fold	O
(	O
)	O
newlines	O
.	O
</s>
<s>
Repeated	O
nodes	O
are	O
initially	O
denoted	O
by	O
an	O
ampersand	O
(	O
)	O
and	O
thereafter	O
referenced	O
with	O
an	O
asterisk	B-Language
(	O
)	O
.	O
</s>
<s>
YAML	B-Protocol
documents	O
in	O
a	O
stream	O
may	O
be	O
preceded	O
by	O
'	O
directives	O
 '	O
composed	O
of	O
a	O
percent	O
sign	O
(	O
)	O
followed	O
by	O
a	O
name	O
and	O
space-delimited	O
parameters	O
.	O
</s>
<s>
Two	O
directives	O
are	O
defined	O
in	O
YAML	B-Protocol
1.1	O
:	O
</s>
<s>
The	O
%YAML	O
directive	O
is	O
used	O
for	O
identifying	O
the	O
version	O
of	O
YAML	B-Protocol
in	O
a	O
given	O
document	O
.	O
</s>
<s>
Optional	O
inline	O
format	O
is	O
delimited	B-Algorithm
by	O
comma+space	O
and	O
enclosed	O
in	O
brackets	O
(	O
similar	O
to	O
JSON	B-General_Concept
)	O
.	O
</s>
<s>
Indented	O
blocks	O
,	O
common	O
in	O
YAML	B-Protocol
data	O
files	O
,	O
use	O
indentation	O
and	O
new	O
lines	O
to	O
separate	O
the	O
key/value	B-Application
pairs	I-Application
.	O
</s>
<s>
Inline	O
Blocks	O
,	O
common	O
in	O
YAML	B-Protocol
data	O
streams	O
,	O
use	O
comma+space	O
to	O
separate	O
the	O
key/value	B-Application
pairs	I-Application
between	O
braces	O
.	O
</s>
<s>
Objects	O
and	O
lists	O
are	O
important	O
components	O
in	O
yaml	B-Protocol
and	O
can	O
be	O
mixed	O
.	O
</s>
<s>
The	O
first	O
example	O
is	O
a	O
list	O
of	O
key-value	B-Application
objects	O
,	O
all	O
people	O
from	O
the	O
Smith	O
family	O
.	O
</s>
<s>
The	O
second	O
lists	O
them	O
by	O
gender	O
;	O
it	O
is	O
a	O
key-value	B-Application
object	O
containing	O
two	O
lists	O
.	O
</s>
<s>
Two	O
features	O
that	O
distinguish	O
YAML	B-Protocol
from	O
the	O
capabilities	O
of	O
other	O
data-serialization	O
languages	O
are	O
structures	O
and	O
data	O
typing	O
.	O
</s>
<s>
YAML	B-Protocol
structures	O
enable	O
storage	O
of	O
multiple	O
documents	O
within	O
a	O
single	O
file	O
,	O
usage	O
of	O
references	O
for	O
repeated	O
nodes	O
,	O
and	O
usage	O
of	O
arbitrary	O
nodes	O
as	O
keys	O
.	O
</s>
<s>
For	O
clarity	O
,	O
compactness	O
,	O
and	O
avoiding	O
data	O
entry	O
errors	O
,	O
YAML	B-Protocol
provides	O
node	O
anchors	O
(	O
using	O
)	O
and	O
references	O
(	O
using	O
)	O
.	O
</s>
<s>
Explicit	O
data	O
typing	O
is	O
seldom	O
seen	O
in	O
the	O
majority	O
of	O
YAML	B-Protocol
documents	O
since	O
YAML	B-Protocol
autodetects	O
simple	O
types	O
.	O
</s>
<s>
floats	B-Algorithm
,	O
ints	O
,	O
strings	O
,	O
lists	O
,	O
maps	O
,	O
...	O
)	O
.	O
</s>
<s>
Many	O
more	O
advanced	O
data	O
types	O
,	O
such	O
as	O
binary	O
data	O
,	O
are	O
defined	O
in	O
the	O
YAML	B-Protocol
specification	O
but	O
not	O
supported	O
in	O
all	O
implementations	O
.	O
</s>
<s>
Finally	O
YAML	B-Protocol
defines	O
a	O
way	O
to	O
extend	O
the	O
data	O
type	O
definitions	O
locally	O
to	O
accommodate	O
user-defined	O
classes	O
,	O
structures	O
or	O
primitives	O
(	O
e.g.	O
</s>
<s>
quad-precision	O
floats	B-Algorithm
)	O
.	O
</s>
<s>
YAML	B-Protocol
autodetects	O
the	O
datatype	O
of	O
the	O
entity	O
,	O
but	O
sometimes	O
one	O
wants	O
to	O
cast	O
the	O
datatype	O
explicitly	O
.	O
</s>
<s>
Not	O
every	O
implementation	O
of	O
YAML	B-Protocol
has	O
every	O
specification-defined	O
data	O
type	O
.	O
</s>
<s>
Here	O
's	O
an	O
example	O
of	O
base64-encoded	O
binary	O
data	O
.	O
</s>
<s>
Many	O
implementations	O
of	O
YAML	B-Protocol
can	O
support	O
user-defined	O
data	O
types	O
for	O
object	B-Application
serialization	I-Application
.	O
</s>
<s>
Local	O
data	O
types	O
are	O
not	O
universal	O
data	O
types	O
but	O
are	O
defined	O
in	O
the	O
application	O
using	O
the	O
YAML	B-Protocol
parser	O
library	O
.	O
</s>
<s>
This	O
sample	O
document	O
defines	O
an	O
associative	B-Application
array	I-Application
with	O
7	O
top	O
level	O
keys	O
:	O
one	O
of	O
the	O
keys	O
,	O
"	O
items	O
"	O
,	O
contains	O
a	O
2-element	O
list	O
,	O
each	O
element	O
of	O
which	O
is	O
itself	O
an	O
associative	B-Application
array	I-Application
with	O
differing	O
keys	O
.	O
</s>
<s>
Relational	O
data	O
and	O
redundancy	O
removal	O
are	O
displayed	O
:	O
the	O
"	O
ship-to	O
"	O
associative	B-Application
array	I-Application
content	O
is	O
copied	O
from	O
the	O
"	O
bill-to	O
"	O
associative	B-Application
array	I-Application
's	O
content	O
as	O
indicated	O
by	O
the	O
anchor	O
(	O
)	O
and	O
reference	O
(	O
)	O
labels	O
.	O
</s>
<s>
Because	O
YAML	B-Protocol
primarily	O
relies	O
on	O
outline	O
indentation	O
for	O
structure	O
,	O
it	O
is	O
especially	O
resistant	O
to	O
delimiter	B-Algorithm
collision	O
.	O
</s>
<s>
YAML	B-Protocol
's	O
insensitivity	O
to	O
quotation	O
marks	O
and	O
braces	O
in	O
scalar	O
values	O
means	O
one	O
may	O
embed	O
XML	B-Protocol
,	O
JSON	B-General_Concept
or	O
even	O
YAML	B-Protocol
documents	O
inside	O
a	O
YAML	B-Protocol
document	O
by	O
simply	O
indenting	O
it	O
in	O
a	O
block	O
literal	O
(	O
using	O
|	O
or	O
)	O
:	O
</s>
<s>
YAML	B-Protocol
may	O
be	O
placed	O
in	O
JSON	B-General_Concept
by	O
quoting	O
and	O
escaping	O
all	O
interior	O
quotation	O
marks	O
.	O
</s>
<s>
YAML	B-Protocol
may	O
be	O
placed	O
in	O
XML	B-Protocol
by	O
escaping	O
reserved	O
characters	O
(	O
,	O
,	O
,	O
,	O
)	O
and	O
converting	O
whitespace	O
,	O
or	O
by	O
placing	O
it	O
in	O
a	O
CDATA	B-Language
section	I-Language
.	O
</s>
<s>
Unlike	O
JSON	B-General_Concept
,	O
which	O
can	O
only	O
represent	O
data	O
in	O
a	O
hierarchical	O
model	O
with	O
each	O
child	B-Data_Structure
node	I-Data_Structure
having	O
a	O
single	O
parent	O
,	O
YAML	B-Protocol
also	O
offers	O
a	O
simple	O
relational	O
scheme	O
that	O
allows	O
repeats	O
of	O
identical	O
data	O
to	O
be	O
referenced	O
from	O
two	O
or	O
more	O
points	O
in	O
the	O
tree	O
rather	O
than	O
entered	O
redundantly	O
at	O
those	O
points	O
.	O
</s>
<s>
This	O
is	O
similar	O
to	O
the	O
facility	O
IDREF	O
built	O
into	O
XML	B-Protocol
.	O
</s>
<s>
The	O
YAML	B-Protocol
parser	O
then	O
expands	O
these	O
references	O
into	O
the	O
fully	O
populated	O
data	O
structures	O
they	O
imply	O
when	O
read	O
in	O
,	O
so	O
whatever	O
program	O
is	O
using	O
the	O
parser	O
does	O
not	O
have	O
to	O
be	O
aware	O
of	O
a	O
relational	O
encoding	O
model	O
,	O
unlike	O
XML	B-Protocol
processors	O
,	O
which	O
do	O
not	O
expand	O
references	O
.	O
</s>
<s>
This	O
expansion	O
can	O
enhance	O
readability	O
while	O
reducing	O
data	O
entry	O
errors	O
in	O
configuration	B-Protocol
files	I-Protocol
or	O
processing	O
protocols	O
where	O
many	O
parameters	O
remain	O
the	O
same	O
in	O
a	O
sequential	O
series	O
of	O
records	O
while	O
only	O
a	O
few	O
vary	O
.	O
</s>
<s>
YAML	B-Protocol
is	O
line-oriented	O
and	O
thus	O
it	O
is	O
often	O
simple	O
to	O
convert	O
the	O
unstructured	O
output	O
of	O
existing	O
programs	O
into	O
YAML	B-Protocol
format	O
while	O
having	O
them	O
retain	O
much	O
of	O
the	O
look	O
of	O
the	O
original	O
document	O
.	O
</s>
<s>
Because	O
there	O
are	O
no	O
closing	O
tags	O
,	O
braces	O
,	O
or	O
quotation	O
marks	O
to	O
balance	O
,	O
it	O
is	O
generally	O
easy	O
to	O
generate	O
well-formed	O
YAML	B-Protocol
directly	O
from	O
distributed	O
print	O
statements	O
within	O
unsophisticated	O
programs	O
.	O
</s>
<s>
Likewise	O
,	O
the	O
whitespace	O
delimiters	B-Algorithm
facilitate	O
quick-and-dirty	O
filtering	O
of	O
YAML	B-Protocol
files	O
using	O
the	O
line-oriented	O
commands	O
in	O
grep	O
,	O
AWK	O
,	O
Perl	B-Language
,	O
Ruby	O
,	O
and	O
Python	B-Language
.	O
</s>
<s>
In	O
particular	O
,	O
unlike	O
markup	O
languages	O
,	O
chunks	O
of	O
consecutive	O
YAML	B-Protocol
lines	O
tend	O
to	O
be	O
well-formed	O
YAML	B-Protocol
documents	O
themselves	O
.	O
</s>
<s>
Counterintuitively	O
,	O
although	O
its	O
indented	O
delimiting	B-Algorithm
might	O
seem	O
to	O
complicate	O
deeply	O
nested	O
hierarchies	O
,	O
YAML	B-Protocol
handles	O
indents	O
as	O
small	O
as	O
a	O
single	O
space	O
,	O
and	O
this	O
may	O
achieve	O
better	O
compression	O
than	O
markup	O
languages	O
.	O
</s>
<s>
JSON-like	O
format	O
)	O
without	O
the	O
indentation	O
;	O
or	O
2	O
)	O
using	O
relational	O
anchors	O
to	O
unwind	O
the	O
hierarchy	O
to	O
a	O
flat	O
form	O
that	O
the	O
YAML	B-Protocol
parser	O
will	O
transparently	O
reconstitute	O
into	O
the	O
full	O
data	O
structure	O
.	O
</s>
<s>
YAML	B-Protocol
is	O
purely	O
a	O
data-representation	O
language	O
and	O
thus	O
has	O
no	O
executable	O
commands	O
.	O
</s>
<s>
While	O
validation	O
and	O
safe	O
parsing	O
is	O
inherently	O
possible	O
in	O
any	O
data	O
language	O
,	O
implementation	O
is	O
such	O
a	O
notorious	O
pitfall	O
that	O
YAML	B-Protocol
's	O
lack	O
of	O
an	O
associated	O
command	O
language	O
may	O
be	O
a	O
relative	O
security	O
benefit	O
.	O
</s>
<s>
However	O
,	O
YAML	B-Protocol
allows	O
language-specific	O
tags	O
so	O
that	O
arbitrary	O
local	O
objects	O
can	O
be	O
created	O
by	O
a	O
parser	O
that	O
supports	O
those	O
tags	O
.	O
</s>
<s>
Any	O
YAML	B-Protocol
parser	O
that	O
allows	O
sophisticated	O
object	O
instantiation	O
to	O
be	O
executed	O
opens	O
the	O
potential	O
for	O
an	O
injection	O
attack	O
.	O
</s>
<s>
Perl	B-Language
parsers	O
that	O
allow	O
loading	O
of	O
objects	O
of	O
arbitrary	O
classes	O
create	O
so-called	O
"	O
blessed	O
"	O
values	O
.	O
</s>
<s>
This	O
may	O
lead	O
to	O
execution	O
of	O
arbitrary	O
Perl	B-Language
code	O
.	O
</s>
<s>
The	O
situation	O
is	O
similar	O
for	O
Python	B-Language
or	O
Ruby	O
parsers	O
.	O
</s>
<s>
Note	O
that	O
the	O
ability	O
to	O
construct	O
an	O
arbitrary	O
Python	B-Language
object	O
may	O
be	O
dangerous	O
if	O
you	O
receive	O
a	O
YAML	B-Protocol
document	O
from	O
an	O
untrusted	O
source	O
such	O
as	O
the	O
Internet	O
.	O
</s>
<s>
The	O
function	O
limits	O
this	O
ability	O
to	O
simple	O
Python	B-Language
objects	O
like	O
integers	O
or	O
lists	O
.	O
</s>
<s>
PyYAML	O
allows	O
you	O
to	O
construct	O
a	O
Python	B-Language
object	O
of	O
any	O
type	O
.	O
</s>
<s>
Even	O
instances	O
of	O
Python	B-Language
classes	O
can	O
be	O
constructed	O
using	O
the	O
tag	O
.	O
</s>
<s>
The	O
YAML	B-Protocol
specification	O
identifies	O
an	O
instance	O
document	O
as	O
a	O
"	O
Presentation	O
"	O
or	O
"	O
character	O
stream	O
"	O
.	O
</s>
<s>
The	O
primary	O
logical	O
structures	O
in	O
a	O
YAML	B-Protocol
instance	O
document	O
are	O
scalars	O
,	O
sequences	O
,	O
and	O
mappings	O
.	O
</s>
<s>
The	O
YAML	B-Protocol
specification	O
also	O
indicates	O
some	O
basic	O
constraints	O
that	O
apply	O
to	O
these	O
primary	O
logical	O
structures	O
.	O
</s>
<s>
Moreover	O
,	O
in	O
defining	O
conformance	O
for	O
YAML	B-Protocol
processors	O
,	O
the	O
YAML	B-Protocol
specification	O
defines	O
two	O
primary	O
operations	O
:	O
dump	O
and	O
load	O
.	O
</s>
<s>
All	O
YAML-compliant	O
processors	O
must	O
provide	O
at	O
least	O
one	O
of	O
these	O
operations	O
,	O
and	O
may	O
optionally	O
provide	O
both	O
.	O
</s>
<s>
Finally	O
,	O
the	O
YAML	B-Protocol
specification	O
defines	O
an	O
information	O
model	O
or	O
"	O
representation	O
graph	O
"	O
,	O
which	O
must	O
be	O
created	O
during	O
processing	O
for	O
both	O
dump	O
and	O
load	O
operations	O
,	O
although	O
this	O
representation	O
need	O
not	O
be	O
made	O
available	O
to	O
the	O
user	O
through	O
an	O
API	B-Application
.	O
</s>
<s>
JSON	B-General_Concept
syntax	O
is	O
a	O
basis	O
of	O
YAML	B-Protocol
version	O
1.2	O
,	O
which	O
was	O
promulgated	O
with	O
the	O
express	O
purpose	O
of	O
bringing	O
YAML	B-Protocol
"	O
into	O
compliance	O
with	O
JSON	B-General_Concept
as	O
an	O
official	O
subset	O
"	O
.	O
</s>
<s>
Though	O
prior	O
versions	O
of	O
YAML	B-Protocol
were	O
not	O
strictly	O
compatible	O
,	O
the	O
discrepancies	O
were	O
rarely	O
noticeable	O
,	O
and	O
most	O
JSON	B-General_Concept
documents	O
can	O
be	O
parsed	O
by	O
some	O
YAML	B-Protocol
parsers	O
such	O
as	O
Syck	O
.	O
</s>
<s>
This	O
is	O
because	O
JSON	B-General_Concept
's	O
semantic	O
structure	O
is	O
equivalent	O
to	O
the	O
optional	O
"	O
inline-style	O
"	O
of	O
writing	O
YAML	B-Protocol
.	O
</s>
<s>
While	O
extended	O
hierarchies	O
can	O
be	O
written	O
in	O
inline-style	O
like	O
JSON	B-General_Concept
,	O
this	O
is	O
not	O
a	O
recommended	O
YAML	B-Protocol
style	O
except	O
when	O
it	O
aids	O
clarity	O
.	O
</s>
<s>
YAML	B-Protocol
has	O
many	O
additional	O
features	O
lacking	O
in	O
JSON	B-General_Concept
,	O
including	O
comments	O
,	O
extensible	O
data	O
types	O
,	O
relational	O
anchors	O
,	O
strings	O
without	O
quotation	O
marks	O
,	O
and	O
mapping	O
types	O
preserving	O
key	O
order	O
.	O
</s>
<s>
Due	O
to	O
the	O
conciseness	O
,	O
JSON	B-General_Concept
serialization	B-Application
and	O
deserialization	B-Application
is	O
much	O
faster	O
than	O
YAML	B-Protocol
.	O
</s>
<s>
TOML	B-Protocol
was	O
designed	O
to	O
be	O
an	O
advancement	O
to	O
the	O
.ini	O
file	O
format	O
.	O
</s>
<s>
YAML	B-Protocol
's	O
minimal	O
use	O
of	O
indicator	O
characters	O
is	O
compared	O
favorably	O
to	O
TOML	B-Protocol
's	O
strict	O
requirement	O
of	O
quotation	O
marks	O
and	O
square	O
brackets	O
.	O
</s>
<s>
YAML	B-Protocol
's	O
use	O
of	O
significant	O
indentation	O
and	O
nesting	O
allows	O
for	O
less	O
verbose	O
structures	O
,	O
a	O
feature	O
which	O
TOML	B-Protocol
does	O
not	O
have	O
on	O
a	O
comparable	O
syntactical	O
level	O
,	O
instead	O
relying	O
on	O
dot	O
notation	O
in	O
their	O
key	O
and	O
table	O
names	O
to	O
convey	O
the	O
same	O
semantic	O
structure	O
.	O
</s>
<s>
YAML	B-Protocol
lacks	O
the	O
notion	O
of	O
tag	O
attributes	O
that	O
are	O
found	O
in	O
XML	B-Protocol
.	O
</s>
<s>
Instead	O
YAML	B-Protocol
has	O
extensible	O
type	O
declarations	O
(	O
including	O
class	O
types	O
for	O
objects	O
)	O
.	O
</s>
<s>
YAML	B-Protocol
itself	O
does	O
not	O
have	O
XML	B-Protocol
's	O
language-defined	O
document	O
schema	O
descriptors	O
that	O
allow	O
,	O
for	O
example	O
,	O
a	O
document	O
to	O
self-validate	O
.	O
</s>
<s>
However	O
,	O
there	O
are	O
several	O
externally	O
defined	O
schema	O
descriptor	O
languages	O
for	O
YAML	B-Protocol
(	O
e.g.	O
</s>
<s>
Doctrine	B-Language
,	O
Kwalify	O
and	O
Rx	O
)	O
that	O
fulfill	O
that	O
role	O
.	O
</s>
<s>
Moreover	O
,	O
the	O
semantics	O
provided	O
by	O
YAML	B-Protocol
's	O
language-defined	O
type	O
declarations	O
in	O
the	O
YAML	B-Protocol
document	O
itself	O
frequently	O
relaxes	O
the	O
need	O
for	O
a	O
validator	O
in	O
simple	O
,	O
common	O
situations	O
.	O
</s>
<s>
Additionally	O
,	O
YAXML	O
,	O
which	O
represents	O
YAML	B-Protocol
data	O
structures	O
in	O
XML	B-Protocol
,	O
allows	O
XML	B-Protocol
schema	O
importers	O
and	O
output	O
mechanisms	O
like	O
XSLT	B-Application
to	O
be	O
applied	O
to	O
YAML	B-Protocol
.	O
</s>
<s>
Comparison	B-Application
of	I-Application
data-serialization	I-Application
formats	I-Application
provides	O
a	O
more	O
comprehensive	O
comparison	O
of	O
YAML	B-Protocol
with	O
other	O
serialization	B-Application
formats	O
.	O
</s>
<s>
For	O
fixed	O
data	O
structures	O
,	O
YAML	B-Protocol
files	O
can	O
simply	O
be	O
generated	O
using	O
print	O
commands	O
that	O
write	O
both	O
the	O
data	O
and	O
the	O
YAML	B-Protocol
specific	O
decoration	O
.	O
</s>
<s>
To	O
dump	O
varying	O
,	O
or	O
complex	O
,	O
hierarchical	O
data	O
,	O
however	O
,	O
a	O
dedicated	O
YAML	B-Protocol
emitter	O
is	O
preferable	O
.	O
</s>
<s>
Similarly	O
,	O
simple	O
YAML	B-Protocol
files	O
(	O
e.g.	O
</s>
<s>
key-value	B-Application
pairs	I-Application
)	O
are	O
readily	O
parsed	O
with	O
regular	O
expressions	O
.	O
</s>
<s>
For	O
more	O
complex	O
,	O
or	O
varying	O
,	O
data	O
structures	O
,	O
a	O
formal	O
YAML	B-Protocol
parser	O
is	O
recommended	O
.	O
</s>
<s>
YAML	B-Protocol
emitters	O
and	O
parsers	O
exist	O
for	O
many	O
popular	O
languages	O
.	O
</s>
<s>
Some	O
are	O
language	O
bindings	O
of	O
the	O
C	B-Language
library	O
libyaml	O
;	O
they	O
may	O
run	O
faster	O
.	O
</s>
<s>
There	O
used	O
to	O
be	O
another	O
C	B-Language
library	O
,	O
called	O
Syck	O
,	O
written	O
and	O
orphaned	O
by	O
why	O
the	O
lucky	O
stiff	O
:	O
it	O
is	O
unmaintained	O
,	O
there	O
is	O
no	O
authoritative	O
source	O
bundle	O
,	O
and	O
the	O
web	O
site	O
has	O
been	O
hijacked	O
.	O
</s>
<s>
Hence	O
the	O
only	O
recommendable	O
C	B-Language
library	O
is	O
libyaml	O
.	O
</s>
<s>
C++	O
programmers	O
have	O
the	O
choice	O
between	O
the	O
C	B-Language
library	O
libyaml	O
and	O
the	O
C++	O
library	O
libyaml-cpp	O
.	O
</s>
<s>
Both	O
have	O
completely	O
independent	O
code	O
bases	O
and	O
completely	O
different	O
APIs	B-Application
.	O
</s>
<s>
The	O
library	O
libyaml-cpp	O
still	O
has	O
a	O
major	O
version	O
number	O
of	O
0	O
,	O
indicating	O
that	O
the	O
API	B-Application
may	O
change	O
at	O
any	O
moment	O
,	O
as	O
happened	O
indeed	O
after	O
version	O
0.3	O
.	O
</s>
<s>
There	O
is	O
a	O
grammar-focused	O
implementation	O
written	O
in	O
C#	O
,	O
with	O
an	O
aim	O
on	O
extensions	O
for	O
the	O
nested	O
elements	O
.	O
</s>
<s>
Some	O
implementations	O
of	O
YAML	B-Protocol
,	O
such	O
as	O
Perl	B-Language
's	O
YAML.pm,	O
will	O
load	O
an	O
entire	O
file	O
(	O
stream	O
)	O
and	O
parse	O
it	O
en	O
masse	O
.	O
</s>
<s>
Thus	O
in	O
YAML.pm,	O
occasionally	O
one	O
must	O
chunk	O
a	O
file	O
into	O
documents	O
and	O
parse	O
those	O
individually	O
.	O
</s>
<s>
YAML	B-Protocol
makes	O
this	O
easy	O
,	O
since	O
this	O
simply	O
requires	O
splitting	O
on	O
the	O
document	O
end	O
marker	O
,	O
which	O
is	O
defined	O
as	O
three	O
periods	O
at	O
the	O
start	O
of	O
a	O
line	O
followed	O
by	O
a	O
whitespace	O
(	O
and	O
possible	O
a	O
comment	O
)	O
.	O
</s>
<s>
YAML	B-Protocol
has	O
been	O
criticized	O
for	O
its	O
significant	B-Language
whitespace	I-Language
,	O
confusing	O
features	O
,	O
insecure	O
defaults	O
,	O
and	O
its	O
complex	O
and	O
ambiguous	O
specification	O
:	O
</s>
<s>
Configuration	B-Protocol
files	I-Protocol
can	O
execute	O
commands	O
or	O
load	O
contents	O
without	O
the	O
users	O
realizing	O
it	O
.	O
</s>
<s>
Editing	O
large	O
YAML	B-Protocol
files	O
is	O
difficult	O
,	O
as	O
indentation	O
errors	O
can	O
go	O
unnoticed	O
.	O
</s>
<s>
For	O
example	O
,	O
unquoted	O
and	O
are	O
converted	O
to	O
booleans	O
;	O
software	O
version	O
numbers	O
might	O
be	O
converted	O
to	O
floats	B-Algorithm
.	O
</s>
<s>
Truncated	O
files	O
are	O
often	O
interpreted	O
as	O
valid	O
YAML	B-Protocol
due	O
to	O
the	O
absence	O
of	O
terminators	O
.	O
</s>
<s>
The	O
perceived	O
flaws	O
and	O
complexity	O
of	O
YAML	B-Protocol
has	O
led	O
to	O
the	O
emergence	O
of	O
stricter	O
alternatives	O
such	O
as	O
and	O
NestedText	O
.	O
</s>
