Hacker News new | ask | show | jobs
by quchen 516 days ago
I’ve come to appreciate power-limited DSLs. The problem is, they are very tricky to design: too simple and users will start templating, or even worse: programming in them (e.g. Yaml+Sh); too powerful and you’ve got yourself another full programming language (e.g. Dhall). I found HCL, although frequently complaining its type system is clearly designed by Go people, to be pretty close to the sweet spot. For each if-loop and other horrid workarounds I’ve had to write, someone else did not write a tower of abstractions that when interpreted, yielded the right result. Maintenance is usually an architectural task, rather than computer science. There are no frameworks to learn, there is no flashy new package manager attached, there is no need to deal with Python pacakge management and such. And, since it’s usually good enough, the effort to add this is disproportionately large, so that nobody does it.

Coming from my Haskell background, I’ll say it like Gabriella Gonzalez once put it [1]: _worst practices should be hard_, and this is where and why I think Terraform/Tofu shine and succeeded.

[1]: https://www.haskellforall.com/2016/04/worst-practices-should...

1 comments

Had a guy invent a DSL for his Greenfield project as an abstraction layer on top of Python. Within a few months he was asking people to write scripts to programmatically generate the DSL.

So now you have DSL-generating script & DSL to version control.

The use case of "people who are computer literate enough to operate within an DSL but not literate enough to program code" is always smaller than people think. And probably not who you want to hire.