YAML: It's Time to Move On

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

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

    Maintainable configuration files

    > Naive question: is it viable if we started using [a Turing-complete programming language]

    This is actually a good question. The people who are not asking and going right ahead with that plan are doing a dangerous thing. <https://www.cs.dartmouth.edu/~sergey/langsec/occupy/> It's not viable because a subset of people would like to have the following properties upheld:

    • Parsing configuration should be decidable and finish in finite time.

    • Parsing configuration should not be a security exploit.

    • I should not have to implement the Emacs runtime just to parse its configuration file.

    > something that's both more flexible but still strict and unambiguous. I wonder if it's possible?

    This really depends on what you mean by these words; I'm interested to hear your idea in detail. Meanwhile, have a look at Dhall <https://dhall-lang.org/> and the other languages mentioned in <https://news.ycombinator.com/item?id=29221643> and compare.

  • json5

    JSON5 — JSON for Humans

    In that case, you might want to have a look at JSON5: https://json5.org/

    It is pretty niche, but attempts to improve upon JSON in a multitude of ways, one of which is the support for comments: https://spec.json5.org/#comments

  • 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.

  • nestedtext

    Human readable and writable data interchange format

    I'm glad to see people experimenting with alternative document/object representations, but this one might be a hard sell: based on the README[1], it only has Python, Zig and Janet implementations so far. One of the nice things about YAML (and JSON, TOML, etc.) is that they have decently mature C, C++, or Rust libraries that other languages bind to.

    [1]: https://github.com/KenKundert/nestedtext

  • starlark

    Starlark Language

    A radically different alternative with a lot going for it is Starlark: https://github.com/bazelbuild/starlark

    It’s a deterministic subset of Python. This means that if you have complex or repetitive configurations, you can use loops and functions to structure them. But it’s impossible to write an infinite loop or recursion.

  • cue

    Discontinued CUE has moved to https://github.com/cue-lang/cue (by cuelang)

  • dadl

    I'm working on my own (you can start the attack hahaha). I feel there's not many simple, generic languages that allow to write simple DSLs with embedded documentation. The self documenting part is still missing but you can take a look and say what you think. It's kind of like yaml format (a bit TOML) with schema and possibility to merge multiple files with smaller chanks of the data. With export to json and yaml. https://github.com/dadlang/dadl

  • prettier

    Prettier is an opinionated code formatter.

    Running prettier (https://prettier.io) on each save will fix trailing commas for you. If you accidentally have one, it will just sneakily remove it and turn your document into one that is valid.

  • 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.

  • Robot Framework

    Generic automation framework for acceptance testing and RPA

    I give you Robot, originally created at Nokia.

    https://robotframework.org

    Back in 2006, the testing was written in HTML tables, no idea how it manage to still be around.

  • dnjs

    DOM Notation JS

    How about just nudge json a couple more notches towards js? https://github.com/leontrolski/dnjs

  • isopod

    An expressive DSL and framework for Kubernetes configuration without YAML

  • skycfg

    Skycfg is an extension library for the Starlark language that adds support for constructing Protocol Buffer messages.

  • typebox

    Json Schema Type Builder with Static Type Resolution for TypeScript

    There's libraries that let you define a schema programmatically, and then infer the types.

    https://github.com/sinclairzx81/typebox

  • jsoneditor

    A web-based tool to view, edit, format, and validate JSON

  • typescript-json-schema

    Generate json-schema from your Typescript sources

    > For more complex cases I find myself wishing I could just turn Typescript into some kind of schema validation for JSON.

    Not sure if this is what you're looking for, and whether it's powerful and expressive enough for your use case, but you can use typescript-json-schema¹ for this, and validate with eg ajv.

    ¹https://github.com/YousefED/typescript-json-schema

  • jsonnet

    Jsonnet - The data templating language

    Btw. Jsonnet doesn't seem too bad either: https://www.youtube.com/watch?v=LiQnSZ4SOnw and here some examples: https://jsonnet.org/ but in my book, EDN still wins.

  • PayloadsAllTheThings

    A list of useful payloads and bypass for Web Application Security and Pentest/CTF

    Not exactly an incompatibility, but my mind jumped to issues like this: https://github.com/swisskyrepo/PayloadsAllTheThings/blob/mas...

        [email protected]

  • ron

    Rusty Object Notation

    You might like RON[1]. It's far from perfect (and far from complete), but seems nice so far.

    [1] https://github.com/ron-rs/ron

  • jq

    Discontinued Command-line JSON processor [Moved to: https://github.com/jqlang/jq] (by stedolan)

  • babashka

    Native, fast starting Clojure interpreter for scripting

    If you're happy to go lispy, there's Babashka [1], a Clojure without the JVM. It has built-in support for 'tasks' designed to make writing build scripts easy.

    [1] https://babashka.org/

  • sublime-json5

    JSON5 support for Sublime Text

    I like it so much I got motivated enough to start making a sublime text highlighter for it. I got a bit lost though, having never made one before.

    And then I tried to use a tool called SBNF to write the grammar for the language at a high level and have it spit out Sublime Text syntax highlighting code. Didn't quite work yet unfortunately.

    https://github.com/bschwind/sublime-json5

    https://github.com/BenjaminSchaaf/sbnf

  • sbnf

    A BNF-style language for writing sublime-syntax files

    I like it so much I got motivated enough to start making a sublime text highlighter for it. I got a bit lost though, having never made one before.

    And then I tried to use a tool called SBNF to write the grammar for the language at a high level and have it spit out Sublime Text syntax highlighting code. Didn't quite work yet unfortunately.

    https://github.com/bschwind/sublime-json5

    https://github.com/BenjaminSchaaf/sbnf

  • openapi-python-client

    Generate modern Python clients from OpenAPI

    Thanks for the link, but not necessarily.

    How WSDL and the code generation around it worked, was that you'd have a specification of the web API (much like OpenAPI attempts to do), which you could feed into any number of code generators, to get output code which has no coupling to the actual generator at runtime, whereas Pyotr is geared more towards validation and goes into the opposite direction: https://pyotr.readthedocs.io/en/latest/client/

    The best analogy that i can think of is how you can also do schema first application development - you do your SQL migrations (ideally in an automated way as well) and then just run a command locally to generate all of the data access classes and/or models for your database tables within your application. That way, you save your time for 80% of the boring and repetitive stuff while minimizing the risks of human error and inconsistencies, while nothing preventing you from altering the generated code if you have specific needs (outside of needing to make it non overrideable, for example, a child class of a generated class). Of course, there's no reason why this can't be applied to server code either - write the spec first and generate stubs for endpoints that you'll just fill out.

    Similarly there shouldn't be a need for a special client to generate stubs for OpenAPI, the closest that Python in particular has for now is this https://github.com/openapi-generators/openapi-python-client

    However, for some reason, model driven development never really took off, outside of niche frameworks, like JHipster: https://www.jhipster.tech/

    Furthermore, for whatever reason formal specs for REST APIs also never really got popular and aren't regarded as the standard, which to me seems silly: every bit of client code that you write will need a specific version to work against, which should be formalized.

  • JHipster

    JHipster, much like Spring initializr, is a generator to create a boilerplate backend application, but also with an integrated front end implementation in React, Vue or Angular. In their own words, it "Is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures."

    Thanks for the link, but not necessarily.

    How WSDL and the code generation around it worked, was that you'd have a specification of the web API (much like OpenAPI attempts to do), which you could feed into any number of code generators, to get output code which has no coupling to the actual generator at runtime, whereas Pyotr is geared more towards validation and goes into the opposite direction: https://pyotr.readthedocs.io/en/latest/client/

    The best analogy that i can think of is how you can also do schema first application development - you do your SQL migrations (ideally in an automated way as well) and then just run a command locally to generate all of the data access classes and/or models for your database tables within your application. That way, you save your time for 80% of the boring and repetitive stuff while minimizing the risks of human error and inconsistencies, while nothing preventing you from altering the generated code if you have specific needs (outside of needing to make it non overrideable, for example, a child class of a generated class). Of course, there's no reason why this can't be applied to server code either - write the spec first and generate stubs for endpoints that you'll just fill out.

    Similarly there shouldn't be a need for a special client to generate stubs for OpenAPI, the closest that Python in particular has for now is this https://github.com/openapi-generators/openapi-python-client

    However, for some reason, model driven development never really took off, outside of niche frameworks, like JHipster: https://www.jhipster.tech/

    Furthermore, for whatever reason formal specs for REST APIs also never really got popular and aren't regarded as the standard, which to me seems silly: every bit of client code that you write will need a specific version to work against, which should be formalized.

  • cdk8s

    Define Kubernetes native apps and abstractions using object-oriented programming

    Ironically, having used cdk8s[1] for dealing with kubernetes infrastructure, that's the one thing where I've actually preferred yaml. That said, k8s resource definitions are pure config so there's no need to try and hack extra bits on top of a serialized data structure.

    [1]https://cdk8s.io/

  • yaml-reference-parser

    > There's no canonical YAML implementation

    The formal grammar counts as canonical and several implementations are derived from it: https://github.com/yaml/yaml-reference-parser

  • yq

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

    > Is there a yaml cli equiv to jq for json?

    You could have found this by searching the Web for "jq for yaml". <https://kislyuk.github.io/yq/>

    > yaml schema

    You could have found this by searching the Web for "yaml schema". <https://rx.codesimply.com/> <https://web.archive.org/web/2021/http://www.kuwata-lab.com/k...>

    In practice, schemas designed for operating on the JSON infoset (not the serialisation) will also work.

  • SaaSHub

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

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