Configuration as Code

The cluster discusses frustrations with declarative configuration formats like YAML and advocates for programmable alternatives such as Dhall, CUE, Jsonnet, Nix, or general-purpose languages to handle complex config needs.

📉 Falling 0.4x DevOps & Infrastructure
3,211
Comments
19
Years Active
5
Top Authors
#8591
Topic ID

Activity Over Time

2008
3
2009
5
2010
11
2011
23
2012
22
2013
37
2014
73
2015
76
2016
88
2017
96
2018
123
2019
303
2020
421
2021
360
2022
377
2023
422
2024
437
2025
314
2026
20

Keywords

e.g CI AWS BLUF FP IDE JavaScr foo.bar lang.org IMO yaml declarative configuration config language cue configs json languages imperative

Sample Comments

AaronFriel Jan 21, 2022 View on HN

I've increasingly found myself drawn to writing declarations as programs, not as config in any plain textual format.Whether it's going all the way in the direction of supporting general purpose languages like Pulumi does, or with a niche but still Turing-complete language like Nix's expression language, or even Dhall, which other commentators have mentioned. That isn't to say there is no place for simple, human readable schema. I think these tools need a fallback to someth

q3k Apr 5, 2020 View on HN

As the article mentions, there's 'real' programming languages made for configuration, that solve at least some of the issues outlined, like Dhall, Cue, Jsonnet. After using both approaches a number of times (a general purpose language vs. one of the three), I'm imploring anyone trying to give this a shot to _not_ use a general purpose language.For instance: I'm mostly familiar with Jsonnet, which has guarantees that make it much easier to use than a Real Language: no

alkonaut Aug 9, 2019 View on HN

I think the future is that all configuration is code. Code in a proper functional/imperative language (preferably the one you wrote the app code in), rather than a special declarative language. The attraction of toml is minimalistic and simple definitions initially - but there is always too much logic for these languages. If not immediately, then eventually."Real" programming languages have good compilers, good error messages, debuggers, IDE's with syntax highlighte

bilalq Jan 23, 2024 View on HN

I'm completely done with configs written in YAML. Easily the worst part of Github Actions, even worse than the reliability. When I see some cool tool require a YAML file for config, I immediately get hit with a wave of apprehension. These same feelings extend to other proprietary config languages like HCL for Terraform, ASL for AWS Step Functions, etc. It's fine that you want a declarative API, but let me generate my declaration programatically.Config declared in and generated by co

karlicoss Apr 5, 2020 View on HN

Looks like Dhall would be a perfect fit for you.> Dhall is a programmable configuration language that you can think of as: JSON + functions + types + importshttps://dhall-lang.org

throwaway290 May 14, 2024 View on HN

Let's all write configuration in imperative turing-complete languages, what could go wrong...

redleader55 Mar 27, 2023 View on HN

Configuration as code, but in a quirky language - how about no? I'm sure someone uses this, someone created this, and so it might seem like it's useful, but we have enough clownishness out there with yaml, json combined with js, json with eval and so on.Create a framework in a normal language, but one which is very limited by design with regard to what is able to access - Skylark/Starlark is a good example[0], "limited Python" and use that. The rest works the same way

dvdkon Apr 30, 2021 View on HN

Have you seen the kind of "config files" YAML is being used nowadays? Gitlab CI, Ansible, Saltstack, various low-code tools... It's no better than a scripting language, because it turns out if what you need is to encode logic and control flow, you can't get away from it by shouting "DECLARATIVE" and pretending the problems don't exist. Pretty much all of these complex tools that use YAML don't use it for declarative purposes, but as a kind of hybrid AST&#x

yen223 Feb 3, 2023 View on HN

"This declarative configuration format is great, but having to define 100 items by hand is tedious and error-prone. Let's make a DSL that supports conditions and loops!""This custom DSL is great, but there's zero tooling for it. Let's use a real language instead!""This Python-based config is great, but my config file takes ages to run, and even longer to understand. Let's make a simple declarative configuration format!"

uryga Sep 1, 2019 View on HN

each of those options have major downsides:- 'dumb data' (json, yaml, ...) is machine-, but not human-friendly. it's often tedious to write/read, and you can't abstract common parts out- DSLs are something you have to write, debug and maintain yourself. is the bug in your config or is it in your DSL's implementation? who knows!- full featured languages require a full blown interpreter and aren't tooling-friendly. as an example: with a Python package, i