top | item 22034157

(no title)

UserIsUnused | 6 years ago

There are plenty of declarative programming language families. Lisps, MLs, SQLs. Configuration is code. Use a programming language.

discuss

order

collyw|6 years ago

So how do you differentiate a declarative language like SQL with a declarative YAML file for Ansible?

What would be the benefit of adding a declaritive language into the mix over YAML?

UserIsUnused|6 years ago

Tooling. Data transformation. Libraries.

Emacs is configured using Lisp. Because of that it is amazingly configurable. XMonad uses Haskell, which gives types to avoid lots of error cases.

The thing is providing an actually programming language doesn't remove anything specially if the same config can be written as cleanly.

And you would avoid "YAML templates for creating YAML", when you actually need to process some data (even if it's just for pre/suffix creation in names). Secrets retrieval is another thing that you also need to do and template.

Also, YAML is a terrible to parse language, with can give out weird error cases. Other languages compilers/interpreters are more mature.

And ofc, if you provide SDKs for your IaC tool, you should be able to use the language that your developers are more familiar with. Taking advantage of the good practices their are used to. Don't limit with "declarative languages". Use a programing language that make more sense, and leave data languages for data.

maweki|6 years ago

If you want to build a DSL, build a DSL. DSLs are easily embeddable in the mentioned programming languages.

YAML is not typed and you can basically do whatever. The worst of all worlds.

dragonwriter|6 years ago

> What would be the benefit of adding a declaritive language into the mix over YAML?

The capability to readily define, store in libraries, and use reusable abstractions that apply within a configuration or across multiple individual configurations.