.yaml, .toml, etc?

      • @[email protected]
        link
        fedilink
        22 years ago

        You might want to checkout NixOS (or home-manager if you don’t want a cold deep dive into a rabbit-hole).

        • @[email protected]
          link
          fedilink
          22 years ago

          You’re probably right I have checked it out, but so far home-manager was a bit of a cold shower to me. I had a ton of trouble wrapping my head around which parts of what config should be responsible for what - and lots of the documentation seems to either be out of date or relying on thing that are still in the ‘testing’ stage?

          I’m interested, but so far just found it frustrating.

          • @[email protected]
            link
            fedilink
            12 years ago

            Hmm yeah it probably helps to be able to program functionally (it’s basically lambda calculus with lazy sets and a little bit of syntax sugar). NixOS has a little bit of a steeper learning curve. When understanding Nix itself and having a little bit dived into the the nixpkgs repo you’ll quickly get a grip for it (and understand some of the IMHO quirky design decisions).

            But then I feel it’s only going to get better, as the system can be perfectly configured to your liking and it stays like that across different machines etc. I think the initial investment has paid off for me so far. It’s really hackable and you can quickly try ideas without having to fear to break your system. Also something like nix flakes for good reproducible dependency management across different OS is really nice (at least if not much if any GUI is involved, then the different worlds (impure vs pure) sometimes clash together).

  • @[email protected]
    link
    fedilink
    English
    12 years ago

    Whatever. Comments are helpful, which makes pure JSON a poor choice. JSON5 or JSON-C are better, but linting and static analysis are important to every form of code, so make sure that what you use for that will understand your syntax.

    My current preference is generally TOML, but I’ve started dabbling with custom HCL2 DSLs. (I write a lot of Go and Terraform.)

  • footfaults [none/use name]
    link
    fedilink
    English
    22 years ago

    I think it’s YAML.

    I’m not happy that it’s YAML but it’s become ubiquitous. Sure, there are lots of other formats that others have mentioned, but I’m sorry most of them are positioned as “it’s better than YAML!” and the fact that everyone is mentioning YAML, even if it’s about the things it does wrong (and boy does it do things wrong) still means that YAML is on everyone’s mind.

  • @[email protected]
    link
    fedilink
    72 years ago

    It really depends. I usually prefer json. It’s easily understandable from humans and from machines, it doesn’t depends on indentation and above everything else I like it very much 🤣

  • randomblock1
    link
    fedilink
    32 years ago

    Need it to be user editable in a text editor? YAML. Otherwise, JSON.

  • @[email protected]
    link
    fedilink
    222 years ago

    JSON by a mile. I hate the YAML plague, it’s some of the most unintuitive syntax I’ve seen and yet it’s everywhere in DevOps/SysOps.

    • Sylveon
      link
      fedilink
      92 years ago

      The only thing that really annoys me about JSON is that it doesn’t allow comments.

    • @[email protected]
      link
      fedilink
      142 years ago

      Yeah, any language in which whitespace count is semantically significant can go suck fat nards.

      • @[email protected]
        link
        fedilink
        English
        92 years ago

        Not sure whether fantastic troll or just no exposure to Python.

        Either way…I’m here for it.

        • @[email protected]
          link
          fedilink
          92 years ago

          Neither, I’ve written plenty of Python and I know how useful it can be. However, as someone who is neurospicy, I find languages that have semantically l significant white space to be frustrating to read.

          Sure, there are tools to help with it. Sure, they help. But they don’t replace how much more useful curly braces are at defining scope.

          • @[email protected]
            link
            fedilink
            English
            22 years ago

            You’re not wrong. Having to figure out which element is borked in a yaml file is not great. And the implementation using yaml is all over the place, so even though tools do exist, they’re mediocre at best.

            But, to be fair, Python has always done the same to me. As a fellow Neuro-spicy (and with a background in Java and C# and JavaScript), although the tools are better to point you in the right direction, significant white space (or indentations) are significant white space (or indentations).🤷‍♂️

    • @[email protected]
      link
      fedilink
      12 years ago

      YAML works better with git than JSON, but so much config work is copy and pasting and YAML is horrible at that.

      Having something where changing one line doesn’t turn into changing three lines, but you could also copy it off a website would be great.

  • @[email protected]
    link
    fedilink
    212 years ago

    I usually use Json5. It’s JSON, but with all the weird quirks fixed (comments added, you can use hex numbers, you can have trailing commas etc.)

      • @[email protected]
        link
        fedilink
        12 years ago

        I don’t know if it’s actual json5, but eslint and some other libraries use extended, commentable json in their config files.

  • @[email protected]
    link
    fedilink
    8
    edit-2
    2 years ago

    No reason to go beyond simple key-value format like dotenv or just env variables. If you need more structure then maybe you are confusing configuration with state and this is not really the same thing.

  • @[email protected]
    link
    fedilink
    82 years ago

    https://nestedtext.org/

    It’s like yaml but simple, consistent, untyped, and you never need to escape any characters, ever.

    Types and validation aren’t going to be great unless they’re in the actual code anyway.