Comment by barishnamazov

1 month ago

This is pretty cool, but I hope it isn't used for human-readable config files. TOML/YAML are better options for that. Git diff also can be tricky with realignment, etc.

I can see potential usefulness of this is in debug mode APIs, where somehow comments are sent as well and are rendered nicely. Especially useful in game dev jsons.

Yaml is the worst. Humans and LLMs alike get it wrong. I used to laugh at XML but Yaml made me look at XML wistfully.

Yaml - just say Norway

  • The Norway issue is a bit blown out of proportion seeing as the country should really be a string `"no"` rather than the `no` value

    • Yeah, but it's a fun slogan. My real peeve is constantly getting the spaces wrong and no tooling to compensete for its warts. If there were linters and test frameworks and unit tests etc for yaml, I'd just sigh and move on. But current situation is, for instance in ADO Yaml: "So it's time to cut a release and time is short - we have a surprise for you! This will make some condition go true which triggers something not tested up till now, you will now randomly commit shit on the release branch until it builds again."

      Stuff that would have been structurally impossible in XML will happen in yaml. And I don't even like XML.

      1 reply →

Just say Norway to YAML.

  • This is a reference to YAML parsing the two letter ISO country code for Norway:

        country: no
    

    As equivalent to a boolean falsy value:

        country: false
    

    It is a relatively common source of problems. One solution is to escape the value:

        country: “no”
    

    More context: https://www.bram.us/2022/01/11/yaml-the-norway-problem/

    • I think it would be better to require quotation marks around all string values, in order to avoid this kind of problems. (It is not the only problem with YAML, but it is my opinion of how any format with multiple types should require explicitly mentioning if it is a string type, but YAML (and some other formats) doesn't.) (If keys are required to strings, then it can be reasonable to allow keys to be unquoted if the set of characters that unquoted keys can contain is restricted (and disallowing unquoted empty strings as keys).)

Yaml works really well with LLMs (not to generate but to consume). So yes, we use it all the time in our service.