3 ms·
In terms of DSLs, this is the crux of Puppet vs. Chef. The danger (and power) of the Chef DSL is it allows imperative Ruby anywhere, including shops that liber
by 1letterunixname 4y ago
In terms of DSLs, this is the crux of Puppet vs. Chef.
The danger (and power) of the Chef DSL is it allows imperative Ruby anywhere, including shops that liberally use monkeypatching "to put out fires".
Puppet is a custom DSL that doesn't have this problem but it lacks the power of Chef.
Declarative is generally even more limited than DSLs like Puppet and can't support complex logic. It maybe worth externalizing complex logic into "helpers" or other systems, but this creates a "Javascript frontend + something else backend" code-synchronization problem.
Declarative seems "easy" and "looks like data" but it rapidly runs into limitations.
(The other confusion with Chef is without unified_mode, there are 2 main execution phases that run on clients: compile-time and converge-time. unified_mode makes it easier for novices whereas 2 phase allows for the compile phase to adjust node settings when using an "API" model without databags or run_state.)
- eru 4y ago> Declarative is generally even more limited than DSLs like Puppet and can't support complex logic. Functional and logic languages would disagree. For configuration, have a look at https://dhall-lang.org/ https://dhall-lang.org/
- colordrops 4y agoNix is fully declarative (with flakes), supports complex logic, and is more powerful that chef and puppet. It is a bit more difficult to learn for those reasons as well.
- 1attice 4y ago+1. YAML is a terrible foundation for a declarative config. You need a language designed for declarative config. Some commenter above said that this space is too messy for a purely declarative language; someone else said Pulumi should be thought of as a macro language to generate a declarative spec. Instead of bolting on a whole Python interpreter to work as a macro language to generate a theoretical declarative spec, why not instead just write a declarative spec in a sanely declarative language? It's not that hard to learn Nix. Stop procrastinating, everyone, and go learn Nix :)
- pydry 4y agoYAML is designed for declarative config.
- 1attice 4y agoGiven that it has none of the features that make Nix bearable, and (if my long memory serves) has repeatedly been busted for truck-sized security holes, and, on top of that, has a grammar that makes me long for that old gif of a hexadecimal keypad, because at least hexadecimal is clear, I'd say it failed, badly.