Yet another “brilliant” scheme from a cryptobro. Naturally this caused a gold-rush for scammers who outsourced random people via the gig economy to open PRs for this yml file (example)

  • rtxn@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    4 months ago

    And what would your ideal, legible, general-purpose data markup language be? XML?

    • Kogasa@programming.dev
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      edit-2
      4 months ago

      Yaml Ain’t Markup Language: am i a joke to you

      (JSON for data, TOML for configuration)

      • rtxn@lemmy.world
        link
        fedilink
        English
        arrow-up
        11
        ·
        4 months ago

        I’ve used both YAML and a TOML-adjacent INI format for Ansible. While I wouldn’t use YAML for massive data serialization (because significant whitespaces are fucking stupid), it’s much better suited for manual data entry compared to most options, including TOML, when nested data structures are required.

        And if YAML’s structure is too complicated, that’s honestly a skill issue.

        • Kogasa@programming.dev
          link
          fedilink
          arrow-up
          5
          arrow-down
          1
          ·
          4 months ago

          Not that YAML’s structure is too complicated, but its syntax is too flexible. All the shit about being whitespace sensitive yet with whitespace errors leading to a syntactically valid YAML document. TOML’s syntax is rigid which makes it unsuitable for expressing complex nested data structures, which is good because that’s not what you should use TOML for. Ultimately the dependence on a highly flexible baseline language like YAML to create complex DSLs is a failure on the developers’ part, and the entire configuration system should be reworked.

          • moonpiedumplings@programming.dev
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            4 months ago

            Do you use a linter like the ansible vscode extension?

            I used to hate writing ansible, and yaml, until I installed the ansible lint vscode extension, and everything became much, much easier.

            Later on, when I was working on a docker-compose, I noticed that the vscode yaml extension (which the ansible extension pulled in as a dependency) caught errors. It’s quite intelligent, able to spot errors exactly like what you mentioned, where the yaml syntax is correct, but the docker-compose, or the ansible syntax is wrong.

            • Kogasa@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              4 months ago

              Of course. If you’re working in a DSL that’s popular enough for someone to have written a good schema/parser for then tooling can help.

        • toastal@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          Significant white space is awesome! Not supporting tabs tho shows you don’t know what you are doing, YAML.

          • Trail@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            4 months ago

            They very well know what they are doing. Take your filthy tabs and get out of here. Spaces only.

    • toastal@lemmy.ml
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      edit-2
      4 months ago

      Depends on the use case but XML is good for markup—especially if you need extensibility.

      For config, Nickel & Dhall take the cake for being typed & having LSPs so the configuration writer can get immediate feedback about possible options (while eliminating invalid states) without requiring the manual—with configuration readers not needing to mess around with marshaling their types. Both these configuration languages let you import files & write little loops to make your config more DRY & makes maintaining large files (like say Kubernetes) easier.

      • rtxn@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

        XML is great if the (de-)serialization is already implemented. Otherwise traversing the document is a massive pain.

        • toastal@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          True. Something like XPath can really help & there are use cases where that is more concise but requires loading XPath into your head like Regex (which tends to get unloaded). The extensibility shines tho as seen by XMPP continuing to this day with very good backwards compatibility with 2 decades of updates since everything in an extension to the base.

      • toastal@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        4 months ago

        Do you remember CSON? CoffeeScript Object Notation was a cute way to make JSON readable before CoffeeScript kinda died.