2 ms·
Oh look its the Chef vs. Puppet imperative vs. declarative argument from 10 years ago... Declarative resources all ultimately get built on top of imperative fo
by lamontcg 4y ago
Oh look its the Chef vs. Puppet imperative vs. declarative argument from 10 years ago...
Declarative resources all ultimately get built on top of imperative foundations, the fundamental building blocks of all these tools we use are imperative.
And the non-expert community of users likes to think in imperative terms and purely declarative abstractions are something that they have a lot of trouble with.
This is why people like Ansible's hacked-up YAML that they can write loops in.
After 20 years or so of configuration management I'm quite convinced that trying to push declarative programming styles directly onto the end user is quite a bit of a failure and produces hard-to-use tooling outside of expert circles (otherwise CFEngine would have been a huge commercial success and we wouldn't bother talking about anything else).
What succeeds is the ability to reuse declarative resources that someone else has written, composeably, to build up larger declarative resources, using imperative glue code. And there's nothing wrong with that because with all these tools the implementation of the declarative primitives is all imperative under the covers.
What we really need is some simple imperative configuration management language to give to users (ideally something about as complicated as the old ANSI C-book) which allow experts to easily plug into a DSL that exports declarative resources for the users, along with easy FFI support out to native libraries and probably ease of calling functions in external languages like python. Dhall is kinda sorta the right direction, but I think it is too based in FP to be broadly accessible to the people are using turing computable YAML.
If Pulumi is doing more or less what I just described then they're probably going down the right path more or less and its probably quite unfair to lob "imperative" at them like an insult, but that is what has been going on for at least the past 10 years though. I don't think there's a single tool out there that is fully imperative and doesn't expose declarative primitives and let you build on them.