4 ms·
Thanks for sharing. There are often good reasons for creating DSLs, internal or external. However I argue that I haven't seen many cases where configuration DS
by 4WIW 6y ago
Thanks for sharing. There are often good reasons for creating DSLs, internal or external.
However I argue that I haven't seen many cases where configuration DSL were well justified.
By configuration here I mean something that describes differences between different deployed instances of the same code. If you take all deployed instances of the existing system and see what is minimal amount of configuration to describe these, you would usually find that very little information, just a few lines would be enough.
The rest of configuration file complexity comes from the designer's attempts to predict the future extensions. My point is, these should be resisted for the sake of future generations of maintainers.
- dkersten 6y agoWhat do you think of the HashiCorp configuration language (HCL)? Overall, I completely agree with you, but I do find that HCL seems to be a pretty good fit for what its used for (at least for Terraform, which I have more experience with than their other tools). My little story was really just me dumping my thoughts after reading about Stevecode, as someone who made a little language (not a configuration language though) and isn't an argument for doing so at all. I'm definitely in favour of sticking with an existing format for configuration (personally, I like to use TOML or EDN for my own projects' configuration needs, or JSON if its not normally meant to be edited by humans) and even for scripting, normally I'd stick with Lua or Javascript. My language came into existence because neither of those was sandboxed in the way I wanted (it was also deterministic and guaranteed to halt as there were no unbounded loops).
- 4WIW 6y agoHah...Terraform is called "Infrastructure as code", so it's HCL language is "code", not configuration, at least by my definition. The whole point of configuration is that it's not code. I use a simple litmus test: can your system work at least to some extent with empty configuration file? If not, you went too far and need to simplify.