<?xml version="1.0" encoding="utf-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><script src="https://www.rss.style/js/atom-style.js" xmlns="http://www.w3.org/1999/xhtml"/><title>Tower of Kubes</title><link rel="self" type="application/atom+xml" hreflang="en" href="https://www.towerofkubes.com/tags/yaml/feed.xml"/><link rel="alternate" type="text/html" hreflang="en" href="https://www.towerofkubes.com/tags/yaml/"/><link rel="alternate" type="application/rss+xml" hreflang="en" href="https://www.towerofkubes.com/tags/yaml/index.xml"/><id>/</id><updated>2025-11-18T00:00:00Z</updated><author><name>Ro'i Bandel</name></author><generator>Hugo 0.157.0</generator><entry><title>New Configuration Languages - MAML and TOON</title><link rel="alternate" type="text/html" hreflang="en" href="https://www.towerofkubes.com/articles/new-configuration-languages/"/><id>https://www.towerofkubes.com/articles/new-configuration-languages/</id><updated>2025-11-18T00:00:00Z</updated><summary type="html">MAML and TOON are two new configuration languages.</summary><content type="html"><![CDATA[<p>I came across this article today: <a href="https://medv.io/blog/things-i-dont-like-in-configuration-languages"  target="_blank" rel="noreferrer">Things I Don’t Like in Configuration Languages</a>. It mentions an overwhelming amount of configuration languages. XML, JSON and YAML are well known, but there are many others, some of which I have heard about and even used (for example, I have used TOML, JSON5 and JSONC), others were entirely new to me (there are more JSON variants than I realized). The article didn’t even mention <a href="/articles/kyaml/" >KYAML</a>.</p>
<p>What’s the solution for this mess? More configuration languages!</p>
<figure><img
    class="my-0 rounded-md"
    loading="lazy"
    decoding="async"
    fetchpriority="low"
    alt="xkcd: Standards"
    src="https://imgs.xkcd.com/comics/standards_2x.png"
    ></figure>
<ul>
<li><a href="https://xkcd.com/927/"  target="_blank" rel="noreferrer">xkcd: Standards</a></li>
</ul>

<h2 class="relative group"><a href="https://maml.dev/"  target="_blank" rel="noreferrer">MAML</a>
    <div id="maml" class="anchor"></div>
    
</h2>

    <details class="admonition quote">
      <summary class="admonition-header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"/></svg>
        <span>Quote</span>
      </summary>
      <div class="admonition-content">
        <p>Minimal. Human-readable. Machine-parsable.</p>

<h2 class="relative group">Rationale
    <div id="rationale" class="anchor"></div>
    
</h2>
<p>JSON is the most popular <em>data-interchange</em> format. But it isn’t a very good <em>configuration</em> language.</p>
<p><strong>MAML</strong> keeps JSON’s simplicity and adds only the needed bits for a good configuration language:</p>
<ol>
<li>Comments</li>
<li>Multiline raw strings</li>
<li>Optional commas</li>
<li>Optional key quotes</li>
<li>Ordered key-value objects</li>
</ol>
<p><strong>MAML</strong> is human-readable and <em>easy to parse</em>.</p>
      </div>
    </details><hr>

    <div class="admonition note">
      <div class="admonition-header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M0 64C0 28.7 28.7 0 64 0L224 0l0 128c0 17.7 14.3 32 32 32l128 0 0 125.7-86.8 86.8c-10.3 10.3-17.5 23.1-21 37.2l-18.7 74.9c-2.3 9.2-1.8 18.8 1.3 27.5L64 512c-35.3 0-64-28.7-64-64L0 64zm384 64l-128 0L256 0 384 128zM549.8 235.7l14.4 14.4c15.6 15.6 15.6 40.9 0 56.6l-29.4 29.4-71-71 29.4-29.4c15.6-15.6 40.9-15.6 56.6 0zM311.9 417L441.1 287.8l71 71L382.9 487.9c-4.1 4.1-9.2 7-14.9 8.4l-60.1 15c-5.5 1.4-11.2-.2-15.2-4.2s-5.6-9.7-4.2-15.2l15-60.1c1.4-5.6 4.3-10.8 8.4-14.9z"/></svg>
        <span>Note</span>
      </div>
      <div class="admonition-content">
        <p><em>Not to be confused</em> with <a href="https://en.wikipedia.org/wiki/Microsoft_Assistance_Markup_Language"  target="_blank" rel="noreferrer">Microsoft Assistance Markup Language</a>.</p>
      </div>
    </div><p>MAML aims to improve on JSON’s strength and overcome its shortcomings.</p>

<h2 class="relative group"><a href="https://github.com/toon-format/toon"  target="_blank" rel="noreferrer">TOON</a>
    <div id="toon" class="anchor"></div>
    
</h2>

    <details class="admonition quote">
      <summary class="admonition-header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"/></svg>
        <span>Quote</span>
      </summary>
      <div class="admonition-content">
        <p>Token-Oriented Object Notation (TOON)
Token-Oriented Object Notation** is a compact, human-readable encoding of the JSON data model for LLM prompts. It provides a lossless serialization of the same objects, arrays, and primitives as JSON, but in a syntax that minimizes tokens and makes structure easy for models to follow.</p>
<p>TOON combines YAML’s indentation-based structure for nested objects with a CSV-style tabular layout for uniform arrays. TOON’s sweet spot is uniform arrays of objects (multiple fields per row, same structure across items), achieving CSV-like compactness while adding explicit structure that helps LLMs parse and validate data reliably. For deeply nested or non-uniform data, JSON may be more efficient.</p>
<p>The similarity to CSV is intentional: CSV is simple and ubiquitous, and TOON aims to keep that familiarity while remaining a lossless, drop-in representation of JSON for Large Language Models.</p>
<p>Think of it as a translation layer: use JSON programmatically, and encode it as TOON for LLM input.</p>
      </div>
    </details><p>TOON aims to be a token-efficient JSON alternative for LLM prompts. It takes inspiration from YAML and CSV.</p>

<h2 class="relative group">My Opinion
    <div id="my-opinion" class="anchor"></div>
    
</h2>
<p>Unlike <a href="/articles/kyaml/" >KYAML</a>, which I tried out almost as soon as I found out about it, I don’t think I will be an early-adopter of either MAML nor TOON. I still don’t quite understand MAML’s rationale, but will be reading more about it. As for TOON, beyond the initial hype, it’s still not clear how good it actually is. Let’s see if either of these gain any traction.</p>
<hr>
<p><em>Featured image by <a href="https://unsplash.com/@flowforfrank?utm_source=hugo&utm_medium=referral"  target="_blank" rel="noreferrer">Ferenc Almasi</a> on <a href="https://unsplash.com/?utm_source=hugo&utm_medium=referral"  target="_blank" rel="noreferrer">Unsplash</a>.</em></p>
]]></content><author><name>Ro'i Bandel</name></author><category term="yaml" label="Yaml" scheme="https://www.towerofkubes.com/tags/yaml/"/><category term="json" label="Json" scheme="https://www.towerofkubes.com/tags/json/"/><published>2025-11-18T00:00:00Z</published></entry><entry><title>KYAML</title><link rel="alternate" type="text/html" hreflang="en" href="https://www.towerofkubes.com/articles/kyaml/"/><id>https://www.towerofkubes.com/articles/kyaml/</id><updated>2025-08-11T00:00:00Z</updated><summary type="html">Today I learned, in Kubernetes v1.34, kubectl will also support a new strict subset of YAML called KYAML.</summary><content type="html"><![CDATA[<p>Today I learned, in Kubernetes v1.34, <code>kubectl</code> will also support a new strict subset of YAML called KYAML.</p>

<h2 class="relative group">Resources
    <div id="resources" class="anchor"></div>
    
</h2>
<ul>
<li><a href="https://kubernetes.io/blog/2025/07/28/kubernetes-v1-34-sneak-peek/#support-for-kyaml-a-kubernetes-dialect-of-yaml"  target="_blank" rel="noreferrer">Support for KYAML: a Kubernetes dialect of YAML | Kubernetes v1.34 Sneak Peek | Kubernetes</a></li>
<li><a href="https://thenewstack.io/kubernetes-is-getting-a-better-yaml/"  target="_blank" rel="noreferrer">Kubernetes Will Solve YAML Headaches with KYAML - The New Stack</a></li>
<li><a href="https://medium.com/@simardeep.oberoi/kyaml-kubernetes-answer-to-yaml-s-configuration-chaos-0c0c09f51587"  target="_blank" rel="noreferrer">KYAML: Kubernetes’ Answer to YAML’s Configuration Chaos | by Simardeep Singh | Aug, 2025 | Medium</a></li>
<li><a href="https://kubernetes.io/blog/2025/08/27/kubernetes-v1-34-release/#alpha-support-for-kyaml-a-kubernetes-dialect-of-yaml"  target="_blank" rel="noreferrer">Kubernetes v1.34: Of Wind & Will (O’ WaW)</a></li>
</ul>

<h2 class="relative group">Shell Script
    <div id="shell-script" class="anchor"></div>
    
</h2>
<p>I coded a simple script to convert all Kubernetes manifests in a directory from YAML to KYAML.</p>
<p>Initially, I wanted to code my own converter, but then found out that the upstream Kubernetes project already has a new yamlfmt tool (different from <a href="https://github.com/google/yamlfmt"  target="_blank" rel="noreferrer">google/yamlfmt</a>).</p>
<div class="highlight-wrapper"><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="cp">#!/bin/sh
</span></span></span><span class="line"><span class="cl"><span class="c1"># kyamlify.sh — Rename *.yaml -> *.kyaml then format to KYAML (POSIX)</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Usage: ./kyamlify.sh [ROOT_DIR]</span>
</span></span><span class="line"><span class="cl"><span class="c1"># Env: YAMLFMT_VERSION (default: master)</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">set</span> -eu
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nv">ROOT_DIR</span><span class="o">=</span><span class="s2">"</span><span class="si">${</span><span class="nv">1</span><span class="k">:-</span><span class="nv">kubernetes</span><span class="si">}</span><span class="s2">"</span>
</span></span><span class="line"><span class="cl"><span class="nv">YAMLFMT_VERSION</span><span class="o">=</span><span class="s2">"</span><span class="si">${</span><span class="nv">YAMLFMT_VERSION</span><span class="k">:-</span><span class="nv">master</span><span class="si">}</span><span class="s2">"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Require Go</span>
</span></span><span class="line"><span class="cl"><span class="nb">command</span> -v go >/dev/null 2><span class="p">&</span><span class="m">1</span> <span class="o">||</span> <span class="o">{</span> <span class="nb">echo</span> <span class="s2">"error: Go not found in PATH"</span> ><span class="p">&</span>2<span class="p">;</span> <span class="nb">exit</span> 1<span class="p">;</span> <span class="o">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">"→ Installing yamlfmt @ </span><span class="nv">$YAMLFMT_VERSION</span><span class="s2">"</span>
</span></span><span class="line"><span class="cl">go install <span class="s2">"sigs.k8s.io/yaml/yamlfmt@</span><span class="si">${</span><span class="nv">YAMLFMT_VERSION</span><span class="si">}</span><span class="s2">"</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">echo</span> <span class="s2">"→ Formatting all YAML files under </span><span class="si">${</span><span class="nv">ROOT_DIR</span><span class="si">}</span><span class="s2"> as KYAML"</span>
</span></span><span class="line"><span class="cl">find <span class="s2">"</span><span class="si">${</span><span class="nv">ROOT_DIR</span><span class="si">}</span><span class="s2">"</span> -type f -name <span class="s1">'*.yaml'</span> -print0 <span class="se">\
</span></span></span><span class="line"><span class="cl">  <span class="p">|</span> xargs -0 -n1 <span class="s2">"</span><span class="k">$(</span>go env GOPATH<span class="k">)</span><span class="s2">/bin/yamlfmt"</span> -o kyaml -w</span></span></code></pre></div></div>

<h2 class="relative group">KYAML Rules
    <div id="kyaml-rules" class="anchor"></div>
    
</h2>

    <div class="admonition quote">
      <div class="admonition-header"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"/></svg>
        <span>Quote</span>
      </div>
      <div class="admonition-content">
        <p><a href="https://kep.k8s.io/5295"  target="_blank" rel="noreferrer">KEP-5295</a> introduces KYAML, which tries to address the most significant problems by:</p>
<ul>
<li>Always double-quoting value strings</li>
<li>Leaving keys unquoted unless they are potentially ambiguous</li>
<li>Always using <code>{}</code> for mappings (associative arrays)</li>
<li>Always using <code>[]</code> for lists</li>
</ul>
      </div>
    </div><ul>
<li><a href="https://kubernetes.io/blog/2025/07/28/kubernetes-v1-34-sneak-peek/#support-for-kyaml-a-kubernetes-dialect-of-yaml"  target="_blank" rel="noreferrer">Support for KYAML: a Kubernetes dialect of YAML | Kubernetes v1.34 Sneak Peek | Kubernetes</a></li>
</ul>
<p>These rules are similar in practice to <a href="https://json5.org/"  target="_blank" rel="noreferrer">JSON5</a>. However, while JSON5 is a <em>superset</em> of JSON (as well as a <em>subset</em> of ES5), KYAML is a <em>subset</em> of YAML.</p>
<p>In fact, I suspect that by adding <code>---</code> to the first line of a JSON5 file, it would be valid KYAML.</p>
<p>By the way, starting the file with <code>---</code> is <strong>required</strong> for KYAML (while it’s optional in YAML).</p>

<h2 class="relative group">Experimentation and Additional Observations
    <div id="experimentation-and-additional-observations" class="anchor"></div>
    
</h2>
<ul>
<li>I was initially excited about converting all my Kubernetes manifests to the “safer” KYAML format.</li>
<li>I ran my script then followed it by running <a href="https://github.com/adrienverge/yamllint"  target="_blank" rel="noreferrer"><code>yamllint</code></a>, which introduced a few warnings post-conversion.</li>
<li>After fixing all yamllint warnings, I had well-formatted KYAML files.</li>
<li>I considered whether to rename all converted manifest files to use a <code>*.kyaml</code> suffix. I decided against this since I couldn’t find any evidence of this file extension.</li>
<li>KYAML files are 100% valid YAML files, and work with existing tooling. This includes existing Kubernetes versions and tooling.</li>
<li>The main thing introduced with Kubernetes v1.34 is a <code>kubectl get -o kyaml</code> option.</li>
<li>Keeping the <code>*.yaml</code> file extension makes sense since KYAML is still valid YAML and existing tools expect <code>*.yaml</code> or <code>*.yml</code> file extensions, not <code>*.kyaml</code></li>
<li>After running the script, fixing formatting, and deciding to keep the filenames the same, I could add all modified files in <code>homelab-as-code</code> to a new <code>kyaml</code> branch and make a commit.</li>
<li>I considered opening a Pull Request, however, am still undecided.</li>
<li>My main consideration is whether the KYAML format would impact usability, making it harder for me to write and edit manifests.</li>
<li>I am not sure whether KYAML solves any real problems for me.</li>
<li>I understand YAML limitations but know how to avoid them by quoting values when needed, using linting and formatting tools (manually, with <a href="https://pre-commit.com/"  target="_blank" rel="noreferrer">pre-commit</a>and in CI).</li>
</ul>

<h2 class="relative group">My Opinion on the Format
    <div id="my-opinion-on-the-format" class="anchor"></div>
    
</h2>
<p>In a way, KYAML is itself “yet another markup language” (despite using existing YAML rules). It is far from the first solution to problems with existing markup languages.</p>
<p>One notable limitation of standarad JSON is no comments. Both <a href="https://json5.org/"  target="_blank" rel="noreferrer">JSON5</a> and Microsoft’s <a href="https://github.com/microsoft/node-jsonc-parser"  target="_blank" rel="noreferrer">JSONC</a> (JSON with comments, primarily used in VS Code’s <a href="https://code.visualstudio.com/docs/configure/settings#_settings-json-file"  target="_blank" rel="noreferrer">setttings.json</a> file) previously addressed this. KYAML has the benefit of being a <em>subset</em> of YAML and designed to work with all existing YAML tooling.</p>
<p>In theory, KYAML could be a “safer” way to write production-grade manifests. However, this was already possible to do with JSON files. Kubernetes manifests can all be written in JSON, but there is a reason that this is rarely done in practice.</p>
<p>JSON files are arguably less readable and harder to work with (for humans, not machines) than YAML. At the same time, JSON files are very much machine-parsable with a lot of existing tooling like <a href="https://jqlang.org/"  target="_blank" rel="noreferrer">jq</a> (though YAML tooling exists as well).</p>
<p>In imitating JSON but staying YAML, KYAML can feel like the worst of both, rather than the best of both world. Not as clean as JSON, and not as “human-readable” as YAML.</p>
<hr>
<p><em>Featured image by <a href="https://unsplash.com/@marvelous?utm_source=hugo&utm_medium=referral"  target="_blank" rel="noreferrer">Marvin Meyer</a> on <a href="https://unsplash.com/?utm_source=hugo&utm_medium=referral"  target="_blank" rel="noreferrer">Unsplash</a>.</em></p>
]]></content><author><name>Ro'i Bandel</name></author><category term="kubernetes" label="Kubernetes" scheme="https://www.towerofkubes.com/tags/kubernetes/"/><category term="k8s" label="K8s" scheme="https://www.towerofkubes.com/tags/k8s/"/><category term="yaml" label="Yaml" scheme="https://www.towerofkubes.com/tags/yaml/"/><category term="tools" label="Tools" scheme="https://www.towerofkubes.com/tags/tools/"/><category term="til" label="Til" scheme="https://www.towerofkubes.com/tags/til/"/><published>2025-08-11T00:00:00Z</published></entry></feed>