One point of user-hostility you face when configuring Linux is all the config files in /etc. Be it crontab, fstab, or iptables, every project has its own ad-hoc config file format and as a rookie user you’re left guessing what the rules for editing each one are. Must you separate entries with tabs or can it be spaces? Does the number of tabs matter? Does this file use # to comment or ;? Can you put a space after = or would that become part of the string? Some projects use their own half-baked implementation of .INI that breaks down the moment you try to escape a string. What’s worse is that since it’s background processes whose files you are editing, the response to a syntax error is nothing happening. The way to test whether you guessed the rules right is to wait and see 🤷

What I’m trying to say is that IMHO, the Linux Kernel and surrounding utilities should agree on a widespread, standardized config format and all migrate to it (prefarably sharing the same C library). The obvious option would be JSON, although it feels a little clunky and doesn’t officially support comments. My preference would be TOML, since it’s like INI which many projects kinda use already, but it’s standardized and has native support for things like arrays (especially useful for fstab/crontab).

  • SubArcticTundra@lemmy.mlOP
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    edit-2
    8 days ago

    Of course a challenge in the Linux ecosystem would be coordinating this change to happen widely and at once (which is important from a UX perspective). Since each of the aforementioned files belongs to a different project, and each project has its own maintainers that would need persuading (or rather inviting to the table to agree on a single format).

    • brian@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      5 days ago

      it’d make more sense to have a translation layer on top that generates configs for everything from a consistent language. you’re never going to get buyin from enough projects to do it directly.

      my system is entirely generated from nix files, 0 handwritten config files. it’s json like if you squint, supports comments, but has functions and can be extended to whatever files you need to generate.

      I do think there’s alternatives in the area, but I don’t think any of them are as complete

    • lime!@feddit.nu
      link
      fedilink
      arrow-up
      6
      ·
      8 days ago

      also ensuring backwards compatibility with everything released in the last 50 years that’s still in use.