Hey again,
About six years ago, I developed a configuration format for my own use in all of my projects, both personal and professional.
A few days ago, I redeveloped it from scratch and have now published it as a public repository: https://github.com/justisr/HMFF
The format is similar to YAML but with some important differences:
- No need for string encapsulation
- No need for character escaping
- All path keys can have values
- No use of periods in path specification
- No complex data structures within the configuration
- Flexible interpretation, won’t error at formatting mistakes (no snakeyml)
- Actual comment support (add/edit comments dynamically)
- I’m pretty sure it’s faster as well, but I haven’t bothered testing that
One thing I want some opinions on though, is actually related to the comments.
Currently, any comment which appears above a key will be attributed to that key.
The root (file) comments are thus attributed to the footer, i.e comments that appear after all of the structure’s keys.
However, many developers want to add headers to their files, rather than footers, and a developer may not know which key to write the header to, because they might not know which key appears first in the file.
On the other hand, specifically writing in support for a file header conflicts with how comments are currently attributed, since the header will appear above the first key. It will either end up attributed to the comments of the first key on reload, or I’ll have to modify the format’s concept so that whitespace appearing between the header and the first key’s comments acts as a real and meaningful indicator; something which isn’t the case for whitespace appearing anywhere else in the file. I hate exceptions.
Nonetheless, I’m currently of the opinion that I should bite the bullet and make that specific whitespace a real and meaningful indictor anyway, because a header’s contents don’t necessarily belong to the first key that appears within the file, so it’d be a much greater violation of the format's concept to attribute them in that way.
Just wondering if anyone has any thoughts.
About six years ago, I developed a configuration format for my own use in all of my projects, both personal and professional.
A few days ago, I redeveloped it from scratch and have now published it as a public repository: https://github.com/justisr/HMFF
The format is similar to YAML but with some important differences:
- No need for string encapsulation
- No need for character escaping
- All path keys can have values
- No use of periods in path specification
- No complex data structures within the configuration
- Flexible interpretation, won’t error at formatting mistakes (no snakeyml)
- Actual comment support (add/edit comments dynamically)
- I’m pretty sure it’s faster as well, but I haven’t bothered testing that
One thing I want some opinions on though, is actually related to the comments.
Currently, any comment which appears above a key will be attributed to that key.
The root (file) comments are thus attributed to the footer, i.e comments that appear after all of the structure’s keys.
However, many developers want to add headers to their files, rather than footers, and a developer may not know which key to write the header to, because they might not know which key appears first in the file.
On the other hand, specifically writing in support for a file header conflicts with how comments are currently attributed, since the header will appear above the first key. It will either end up attributed to the comments of the first key on reload, or I’ll have to modify the format’s concept so that whitespace appearing between the header and the first key’s comments acts as a real and meaningful indicator; something which isn’t the case for whitespace appearing anywhere else in the file. I hate exceptions.
Nonetheless, I’m currently of the opinion that I should bite the bullet and make that specific whitespace a real and meaningful indictor anyway, because a header’s contents don’t necessarily belong to the first key that appears within the file, so it’d be a much greater violation of the format's concept to attribute them in that way.
Just wondering if anyone has any thoughts.
