YAML: YAML Ain't Markup Language™
Origin
flowchart TB
SGML["Standard Generalized Markup Language (SGML)"] --> XML
XML["Extensible Markup Language (XML)"] --> SML
SML["Simple Markup Language (SML)"] --> YAML
YAML["YAML Ain't Markup Language (YAML)"] -..-|happened to have similar syntax| similar
subgraph similar[similar object notation]
direction TB
JSON
Python
NewtonScript
end
Names
- YML - The Why Markup Language (source: mail thread from 1999)
- Originally “Yet Another Markup Language”
- Nowadays “YAML Ain’t Markup Language” (recursive acronym)
Version differences
Feature | YAML 1.1 | YAML 1.2 |
---|---|---|
Booleans “on/off” & “yes/no” | ✅ | ❌ |
Octals “0700” | ✅ | ❌ |
Octals “0o700” | ❌ | ✅ |
Base-60 (sexagesimal) “190:20:30” | ✅ | ❌ |
Underscores in numbers “1_2_3” | ✅ | ❌ |
Nice website comparing v1.1 & v1.2: https://perlpunk.github.io/yaml-test-schema/schemas.html
Weird syntax
Null
a: null
b: !!null null
c: # empty also means null
d: ~ # tilde also means null
Sets
a: { x, y, z }
b: { x:, y:, z: }
c: { x: null, y: null, z: null }
d:
? x
? y
? z
Merge keys
https://yaml.org/type/merge.html
Introduced in v1.1
|
|
Cool facts
- Their website is YAML: https://yaml.org