Why JSON Isn’t a Good Configuration Language (2018)

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

    Type-safe YAML parser and validator.

  • To me those are in the category of "nice to have", and the problem is that every developer has different preferences for these [1] [2]. But the main features of StrictYaml, like supporting comments and less syntactic noise, I think are pretty uncontroversial, and perhaps it's worth it to get people to switch over for those alone. It doesn't need to be perfect, it just needs to be a significant enough improvement over JSON, and I'd say those two features are more than enough

    [1]: https://github.com/crdoconnor/strictyaml/issues/37

    [2]: https://github.com/crdoconnor/strictyaml/issues/38

  • awesome-jsonschema

    A curated list of awesome JSON Schema resources, tutorials, tools, and more.

  • Write your own is a bad option. I have tried it and found that you end up spending lots of time maintaining a parser.

    I have found some success in my org using JSON with JSON Schema [1]. Combine with a json schema aware IDE like VS Code it solves the documentation problem.

    [1] https://json-schema.org/

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

    JSON for Modern C++

  • In C++ you get the great https://github.com/nlohmann/json

    In Rust you have the amazing serde with serde_json but at this point, you can use toml which is also based on serde. I consider serde as being standard.

    In C you have the lib jason which is very good.

    In Elixir, I use the compile-time configuration (config/config.exs) with environment variables for production, but that's because in the end, my Elixir system is in a Docker container, running on Kubernetes, with a ConfigMap defining the environment variables, so in the end, it's YAML (or JSON).

  • toml

    Tom's Obvious, Minimal Language

  • jsonnet

    Jsonnet - The data templating language

  • jsonnet[1] might suit your use-case better, it was created to do exactly that.

    [1]https://jsonnet.org

  • json-schema-to-typescript

    Compile JSONSchema to TypeScript type declarations

  • jsonnet is my go-to language for anything related to configuration, after having tried json, yaml, TS, edn, and tasting dhall and toml. It addresses all problems in the article and more.

    the composition strikes a good balance between extensiveness and ease of use.

    the generated json leads to easy and portable data, and if you write jsonschemas from jsonnet, tools like json-schema-to-typescript [1] make it easy to import a consistent interface, and almost every language has a reasonably up-to-date validation library.

    [1] https://github.com/bcherny/json-schema-to-typescript

  • go

    The Go programming language

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

    Discontinued S-Expression Configuration Language

  • For me personally, I'd love for SECL to be a standard configuration language. Sadly, it is a chicken and egg problem.

    https://github.com/rls-moe/secl

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