The YAML Document from Hell

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • edn

    Extensible Data Notation

  • Sure!

    Spec: https://github.com/edn-format/edn

    Example (linter config): https://github.com/clj-kondo/clj-kondo/blob/634294183a0aa2ca...

  • yq

    Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents (by kislyuk)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • ytt

    YAML templating tool that works on YAML structure instead of text

  • > Templating yaml is a terrible, terrible idea

    I've had a good time using ytt: https://carvel.dev/ytt/. It implements language-aware templating, which is IMO the only reasonable way to do it.

  • jsonnet

    Jsonnet - The data templating language

  • I wonder why generated JSON is not used more widely, something like jsonnet[0], although I've never used it.

    Most systems come with Python 3 installed, which supports working with JSON[1] without installing any dependencies. So, I'm wondering if we could use Python to generate JSON data that is then consumed by other tools. This would fix the lack of comments and trailing commas in JSON, you get functions and other abstractions from Python, and you don't need to install any third-party tools (vs. something like jsonnet).

    [0]: https://jsonnet.org/

    [1]: https://docs.python.org/3/library/json.html

  • json5

    JSON5 — JSON for Humans

  • People often forget about the environment, and I feel like a lot of the simpler services and applications could be configured through it easily.

    For anything that requires more complex structures, JSON5 (https://json5.org/) has been gaining traction. It's basically JSON that allows a couple of more things, including comments and unquoted keys, if you're into that.

  • hydra

    Hydra is a framework for elegantly configuring complex applications (by facebookresearch)

  • For managing configs of ML experiments (where each experiment can override a base config, and "variant" configs can further override the experiment config, etc), Hydra + Yaml + OmegaConf is really nice.

    https://hydra.cc/

    I admit I don't fully understand all the advanced options in Hydra, but the basic usage is already very useful. A nice guide is here:

    https://florianwilhelm.info/2022/01/configuration_via_yaml_a...

  • judo

    Simple orchestration & configuration management

  • Ansible and YAML were my primary (de)motivators to create Judo (https://github.com/rollcat/judo). This combo is extremely frustrating: for every line in a (hypothetical) shell script that would do one thing, I needed 3-5 (sometimes many more) lines of YAML. Most people on the team who were just getting started with Ansible, would often do half of their work just shelling out. I would usually push to do things "the Ansible way", but even I had to acknowledge the mental overhead of translating back & forth. I think what finally pushed me over the edge was when we started venturing into compose & k8s, and had to mix & juggle YAML+Jinja in two entirely different contexts, each with its own quirks, bugs, gotchas and brain damage.

    I figured I just need a layer of glue to run shell scripts across a bunch of remote hosts (hence Judo), and otherwise resort to other tooling (like Terraform, AWS CLI, k8s CLI, etc) for problems that don't map to SSH.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • clj-kondo

    Static analyzer and linter for Clojure code that sparks joy

  • Sure!

    Spec: https://github.com/edn-format/edn

    Example (linter config): https://github.com/clj-kondo/clj-kondo/blob/634294183a0aa2ca...

  • strictyaml

    Type-safe YAML parser and validator.

  • That safe subset exists and is implemented in a number of languages. It is called strict-yaml: https://hitchdev.com/strictyaml/

  • toml

    Tom's Obvious, Minimal Language

  • > I still think it's the best format out there.

    What do you think of https://toml.io ?

  • hjson

    Hjson, a user interface for JSON

  • ```

    YAML and JSON succeeded because they had a clean and predictable, no-nonsense mapping between encoding and object-model after decoding. Probably we should all switch to an almost-yaml format that does away with the peculiarities, and the FANG companies would have the momentum to make that happen.

    I personally would like for HJSON (https://hjson.github.io) to see more adoption, but that train has passed...

  • dune

    A composable build system for OCaml.

  • sxpyr

    Parse s-expressions, edn, and a variety of lisp dialects.

  • 4. still better than yaml and json

    0. https://github.com/tgbugs/sxpyr

  • tanka

    Flexible, reusable and concise configuration for Kubernetes

  • At Grafana Labs we're using jsonnet at scale, while being a powerful functional language it is also excellent for rendering JSON/YAML config. We have developed Tanka[0] to work with Kubernetes, for other purposes I can recommend this course[1] (authored by me).

    [0] https://tanka.dev/

    [1] https://jsonnet-libs.github.io/jsonnet-training-course/

  • nestedtextto

    CLI to convert between NestedText and JSON, YAML, or TOML, with explicit type casting

  • I'm a huge fan of NestedText, especially as there is no escaping needed ever.

    If you ever want to use it as a pre-format to generate either TOML, JSON, or YAML, I used the official reference implementation to make a CLI converter between them and NestedText.

    When generating one of these formats, you can use yamlpath queries to concisely but explicitly apply supported types to data elements.

    - My CLI converter: https://github.com/AndydeCleyre/nestedtextto

    - yamlpath info: https://github.com/wwkimball/yamlpath/wiki/Search-Expression...

  • yamlpath

    YAML/JSON/EYAML/Compatible get/set/merge/validate/scan/convert/diff processors using powerful, intuitive, command-line friendly syntax.

  • I'm a huge fan of NestedText, especially as there is no escaping needed ever.

    If you ever want to use it as a pre-format to generate either TOML, JSON, or YAML, I used the official reference implementation to make a CLI converter between them and NestedText.

    When generating one of these formats, you can use yamlpath queries to concisely but explicitly apply supported types to data elements.

    - My CLI converter: https://github.com/AndydeCleyre/nestedtextto

    - yamlpath info: https://github.com/wwkimball/yamlpath/wiki/Search-Expression...

  • sexplib

    Automated S-expression conversion

  • sexp

    S-expression swiss knife

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts