8 ms·
I don't understand why they are using JSON, especially systemd already use an INI-like config format extensively. Maybe because they are not web devs so that t
by kbumsik 7y ago
I don't understand why they are using JSON, especially systemd already use an INI-like config format extensively.
Maybe because they are not web devs so that they haven't had an annoying moment when they realize there is no proper way to add comments in package.json?
- viraptor 7y agohttps://systemd.io/USER_RECORD/ https://systemd.io/USER_RECORD/ > Why JSON? > JSON is nicely extensible and widely used. In particular it’s easy to synthesize and process with numerous programming languages. It’s particularly popular in the web communities, which hopefully should make it easy to link user credential data from the web and from local systems more closely together.
- jmcs 7y ago> It’s particularly popular in the web communities, which hopefully should make it easy to link user credential data from the web and from local systems more closely together. Was this written by a CSI or NCIS screenwriter?
- throwaway17_17 7y agoI’m not asking rhetorically: Is a closer coupling between ‘the Web’ and local systems (especially concerning login and personal id) really what anyone needs? I don’t even think it’s what anyone really wants, but sure, let’s find a way to make some random server located somewhere run by some SaaS be responsible for negotiating rights to access our own hardware.
- GauntletWizard 7y agohttps://news.ycombinator.com/item?id=22287174 https://news.ycombinator.com/item?id=22287174 was on the front page of HN in the last 24h. Yes, web access to hardware is a top priority, because for a large portion of everywhere compute hardware is leased by the hour. It may not be the only way to access things, and I don't think the systemd maintainers will argue with you over the importance of single-box authentication robustness, only that compatibility is worthwhile and among the arbitrary formats there is a clear winner.
- throw0101a 7y ago> ... should make it easy to link user credential data from the web and from local systems more closely together. Why would anyone want to do such a thing? This sounds like an anti-feature (non-goal?) to me.
- opless 7y agoI don’t understand it either. JSON and YAML do not belong in *nix config files. What else will systemd do next? Audio? Kernel functions? Send mail? Read news? Become a web browser?
- LessDmesg 7y agoBecome Windows. That was Red Hat's plan all along. And then your personal data will end up on their cloud like with Win10.
- syshum 7y agoit took IBM 4 years before it ruined Weather Underground and injected its corporate cancer on the Apps and Sites So I figure it will no later then 2023 before RedHat becomes IBM...
- deleted 7y ago[deleted]
- catalogia 7y agoTIL IBM bought the Weather Channel a few short years after the Weather Channel bought Weather Underground.
- Spivak 7y agoI can agree with JSON being inappropriate in some circumstances but YAML is a super ergonomic config format. It gives you lots of niceties when you editing a file by hand and then you can just output a JSON object if you're generating the config with code. It's my favorite thing ever to do something like: - name: Configure $service. copy: dest: /path/to/config.yml content: >- --- {{ config_obj | to_nice_json }} in Ansible.
- edejong 7y agoYAML is probably the least ergonomic configuration format available. [1] Even XML would be preferable, as at least most XML parsers are interchangable. [1] https://www.arp242.net/yaml-config.html https://www.arp242.net/yaml-config.html
- fctorial 7y ago{ ... "comment": "this is a comment", ... }
- switch007 7y agoIs that a comment...or a key called "comment"? :p Surely "#__comment__!11!!1#" would reduce the confusion !
- skywhopper 7y agoYeah, that doesn’t scale very well...
- fctorial 7y agoPut cursor after "t" in "comment" and slap your keyboard.
- laumars 7y agoComments are meant to stand apart from code, which that doesn't. Also that would only work if your JSON doesn't have a schema or the importing tool is lazy (ie doesn't validate properties against an expected structure).
- RabbiPires 7y agoUser editable files should _not_ be in JSON. TOML, YAML or heck, even INI (which is already in use by systemd anyway!) is better.
- jolmg 7y agoOr you know, you can just do your language equivalent of: grep -Pv '^\s*#' to remove comments, passing the output of that to the JSON parser. The extension could be modified to .cjson, .json.commented, or something. Good thing JSON doesn't permit literal newlines in strings. Any valid JSON should be able to go through that comment filter without getting modified.
- catalogia 7y ago
- mangecoeur 7y agoAFAICT JSON user records are only about serializing data to disk and between systemd components, not to be used as configuration files.
- _pmf_ 7y agoBecause having the inevitable dozens of "why JSON" discussions at the beginning is much less tiring than having tens of thousands of "why not JSON" discussions throughout the project history.