You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@stas00 Apologies for the radio silence and for stalling your progress.
Your point is well made regarding silent errors from typos in the config file. In the past, users have actually exploited this lack of validation as a way to convenient disable features without deleting the entries. So perhaps a reasonable solution would be to introduce yet another config option to validate the config entries and issue a warning for each unrecognized entry. What do you think?
Oh, no problem, I'm sure you guys need some breaks too!
Your suggestion to make the validation optional would work great, @tjruwase. This is a very low priority feature request.
Since you mentioned that the lack of validation is exploited to make users' life easier, I'm also thinking that json isn't a user-friendly format for configuration, because it has a ton of problems, e.g.:
don't put comma there, but must put it here,
can't use comments, specifically to comment something out while experimenting - must delete instead and deal with commas again
can't use python 5_000_000_000 numbers - who can read 5000000000 - I switched to using 5e8 for ZeRO buffers in our examples.
json, IMHO, is more of an inter-program format, rather than designed for human manipulation.
It'd have been much better to use some other, more user-friendly format, IMHO. But it has been a while since I had to deal with config files so I'm not sure what's the standard these days.
Thanks @stas00, JSON validation I think is on our radar and definitely something we should add in the short term. Also agree JSON isn't the most user-friendly of formats. We'll have to look into alternatives. I have heard good things about hjson. It allows commas/comments but I don't think supports numbers in the way you describe unfortunately. YAML might also be a reasonable option but also comes with difficulties haha
It appears YAML supports numbers like 5_000_000_000 and comments. We'll have to look into this further.
I don't know how your user/developer community works, perhaps throwing the net wider would give practical feedback from users who may have used hjson already and can tell how good it is in practice.
Activity
tjruwase commentedon Jan 13, 2021
@stas00 Apologies for the radio silence and for stalling your progress.
Your point is well made regarding silent errors from typos in the config file. In the past, users have actually exploited this lack of validation as a way to convenient disable features without deleting the entries. So perhaps a reasonable solution would be to introduce yet another config option to validate the config entries and issue a warning for each unrecognized entry. What do you think?
stas00 commentedon Jan 13, 2021
Oh, no problem, I'm sure you guys need some breaks too!
Your suggestion to make the validation optional would work great, @tjruwase. This is a very low priority feature request.
Since you mentioned that the lack of validation is exploited to make users' life easier, I'm also thinking that json isn't a user-friendly format for configuration, because it has a ton of problems, e.g.:
json, IMHO, is more of an inter-program format, rather than designed for human manipulation.
It'd have been much better to use some other, more user-friendly format, IMHO. But it has been a while since I had to deal with config files so I'm not sure what's the standard these days.
tjruwase commentedon Jan 13, 2021
Completely agree with the pain of json, so we are very open to any suggestions.
jeffra commentedon Jan 13, 2021
Thanks @stas00, JSON validation I think is on our radar and definitely something we should add in the short term. Also agree JSON isn't the most user-friendly of formats. We'll have to look into alternatives. I have heard good things about hjson. It allows commas/comments but I don't think supports numbers in the way you describe unfortunately. YAML might also be a reasonable option but also comes with difficulties haha
It appears YAML supports numbers like 5_000_000_000 and comments. We'll have to look into this further.
stas00 commentedon Jan 13, 2021
I was going to suggest YAML, but I thought that something better must have been invented since then. YAML is from around 2001 if I remember correctly.
I have never used https://hjson.github.io/, but it does look like the most straightforward solution as it was created to overcome limitations of json for human use. May be that's all is needed.
I don't know how your user/developer community works, perhaps throwing the net wider would give practical feedback from users who may have used hjson already and can tell how good it is in practice.