TOML: Tom's Obvious Minimal Language

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

Our great sponsors
  • InfluxDB - Collect and Analyze Billions of Data Points in Real Time
  • Sonar - Write Clean Python Code. Always.
  • Revelo Payroll - Free Global Payroll designed for tech teams
  • Onboard AI - Learn any GitHub repo in 59 seconds
  • toml

    Tom's Obvious, Minimal Language

    JSON is basically perfect if it allowed trailing commas and comments. TOML is not a replacement for JSON because of how badly it chokes on nested lists of objects (both hard to read and hard to write), due to a misguided attempt to avoid becoming JSON-like[1].

    [1] https://github.com/toml-lang/toml/issues/516

  • json5

    JSON5 — JSON for Humans

    > JSON is basically perfect if it allowed trailing commas and comments.

    I agree, especially in regards to the comments, because sometimes the data itself isn't enough and additional human-readable context can be really useful!

    In that regard, JSON5 is a wonderful idea, even if sadly it isn't widespread: https://json5.org/

    It also supports the trailing commas and overall just feels like what JSON should be, to make it better without overcomplicating it.

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • pytoml

    A TOML-0.4.0 parser/writer for Python.

    Funny thing: TOML author/inventor calls it a mistake:

    > TOML is a bad file format. It looks good at first glance, and for really really trivial things it is probably good. But once I started using it and the configuration schema became more complex, I found the syntax ugly and hard to read.

    > I personally abandoned TOML and as such, I'm not planning on adding any new features

    https://github.com/avakar/pytoml/issues/15#issuecomment-2177...

  • JSON6

    JSON for Humans (ES6)

    I pretty like the idea of a superset of JSON taht supports (1) comments, (2) trailing commas, (3) unquoted properties, (4) optional {} for the root object, (5) multi-line strings, (6) number separator.

    JSON6 proposal [1] supports all of this, except (4). Unfortunately it also supports more and make the spec a bit too complex for my taste (JSON has a compact spec; any extension should honor this). Same issue with JSON5 proposal [2].

    EKON [3] is certainly the best candidate. However, it doesn't get any traction.

    [1] https://github.com/d3x0r/JSON6

  • ekon

    A JSON alternative for sane people. Combination of simplicity & power. Check it out!

  • cue

    The home of the CUE language! Validate and define text-based and dynamic configuration

    Among types and other useful properties, CUE supports everything you asked for.

    https://cuelang.org

  • gura

    Gura configuration language

    If one is looking for an alternative config format, the best designed I've seen is https://github.com/gura-conf/gura

  • Sonar

    Write Clean Python Code. Always.. Sonar helps you commit clean code every time. With over 225 unique rules to find Python bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.

  • config

    configuration library for JVM languages using HOCON files

  • knot8

    define and manipulate "knobs" in K8s manifests

    I played around with "format preserving" edits of a few text formats, including nested formats (a JSON inside a TOML inside a YAML etc)

    https://github.com/mkmik/knot8

  • jsonnet

    Jsonnet - The data templating language

    I like Google's Jsonnet [1], which has all of this except for 4.

    Jsonnet is quite mature, with fairly wide language adoption, and has the benefit of supporting expressions, including conditionals, arithmetic, as well as being able to define reusable blocks inside function definitions or external files.

    It's not suitable as a serialization format, but great for config. It's popular in some circles, but I'm sad that it has not reached wider adoption.

    [1] https://jsonnet.org/

  • rust-playground

    The Rust Playground

    > In my experience (Python and Rust) missing keys are errors, not silently converted to None:

    In Rust it's possible to deserialize to an Option.

    https://play.rust-lang.org/?version=stable&mode=debug&editio...

  • pyspnego

    Python SPNEGO authentication library

    Can you share an actual example where you need to specify requirements twice. With pyproject.toml I know of 3 ways requirements are specified and they are all used by different things:

    1. Build requirements - requirements needed to build your package from an sdist

    2. Runtime requirements - requirements your library needs at runtime

    3. Extra requirements - optional runtime requirements

    For example my library pyspnego https://github.com/jborean93/pyspnego/blob/main/pyproject.to... has all 3:

    1. Cython for Win32 needed to build the sdist and setuptools as the general build system - https://github.com/jborean93/pyspnego/blob/c3db058b636fc102f...

    2. cryptography as a runtime dependency - https://github.com/jborean93/pyspnego/blob/c3db058b636fc102f...

    3. optional extras kerberos and yaml - https://github.com/jborean93/pyspnego/blob/c3db058b636fc102f...

    Granted the toml format and what is used in pyproject.toml has it's warts but I'm curious what your joke and clown_fiesta examples are actually from as from where I am standing each section currently serve different purposes.

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