What does HackerNews think of dhall-kubernetes?
Typecheck, template and modularize your Kubernetes definitions with Dhall
Note yaml is not a DSL. It's a tree serialization format! Everything interesting is happening after it is parsed. Extreme examples point to e.g. github actions conditions.
Anyway, back on topic - maybe not prolog for CDK, but still quite interesting: Dhall-kubernetes - https://github.com/dhall-lang/dhall-kubernetes
Example: https://github.com/dhall-lang/dhall-kubernetes
Haven’t used dhall myself but I’d definitely prefer a DSL on top of yaml.
I manage DNS in Terraform, and since every Terraform provider uses different objects definitions, and every object definition is rather verbose, Dhall would be a way to specify my own DRY types and leave the provider-specific details in one place. Adding new DNS entries and moving several domains between providers would be a matter of changing fewer lines.
Dhall also has Kubernetes bindings:
https://github.com/dhall-lang/dhall-kubernetes
Although I'm tempted to just stick to Helm here: even though it's less type-safe, Dhall's verbosity makes me reconsider.
I'd like to hear if anyone has used dhall-kubernetes if they like it.
E.g. for Kubernetes: https://github.com/dhall-lang/dhall-kubernetes
[0] https://dhall-lang.org/ [1] https://github.com/dhall-lang/dhall-kubernetes
This had to be pointed out; Pulumi's docs repeat the adjective "real", as if its competitors aren't real. "real code", "real package management" [2], "real languages" [3], "real programming model" [4]... Nix and Dhall are quite real, though. So is this an incomplete survey, or are Pulumi's docs unrealistically self-aggrandizing? TBH even just this one paragraph of yours is pretty tough to stomach, as if loops and functions in a configuration language were a novel concept.
[0] https://github.com/xtruder/kubenix
[1] https://github.com/dhall-lang/dhall-kubernetes
[2] https://www.pulumi.com/docs/intro/vs/k8s_yaml_dsls/
There are already kubernetes bindings available https://github.com/dhall-lang/dhall-kubernetes .
The syntax in the examples looks a bit more verbose and less readable than yaml but I think building sensible abstractions on top of it will alleviate the pain (abstractions here are innocuous since you can 'normalize' the code and they disappear)
I'm not too happy with the default formatting though. I think if the formatter indented nested values similar to yaml that would look better to the human eye.
It's GCL but with a strong type system and termination guarantees.
I personally like the syntax a bit more than jsonnet. It's a bit less noisy.
I'm also a bit biased because I work on https://github.com/dhall-lang/dhall-kubernetes . We're currently working on a 2.0 release so the current state of the repo is a bit in turmoil.
Programmable configuration language like dhall an jsonet are very powerful and I like them way more than for example helm charts, where templating happens on the string level instead of at the data level.
Because your build then becomes an actual program (i.e. Turing complete) and you have to refactor and maintain it! This is the common problem of using a "programming language as configuration" (e.g. gulp?)
Dhall solves exactly this problem: https://dhall-lang.org
It has the same premises of Pulumi, but without the Turing completeness (I don't know if/how Pulumi avoids that, but if it does it should be part of the pitch), so you cannot shoot yourself in the foot by building an abstraction castle in your build system/infrastructure config.
We use it at work to generate all the Infra-as-Code configurations from a single Dhall config: Terraform, Kubernetes, SQL, etc.
And there is already an integration with Kubernetes: https://github.com/dhall-lang/dhall-kubernetes
If you need some example of use cases to see if it might help you, check out "Dhall in Production" [0]
So far I'm a maintainer of dhall-kubernetes [1] and we'll soon open source some of our integration with Terraform.
And because it's absolutely safe to distribute Dhall code I'm toying with the idea of making some kind of Dhall-Kafka pubsub, in which you can safely distribute Dhall code and data, with automatic version migrations (check this out for more info on why this is possible [2])
[0]: https://github.com/dhall-lang/dhall-lang/wiki/Dhall-in-produ...
[1]: https://github.com/dhall-lang/dhall-kubernetes
[2]: http://www.haskellforall.com/2017/11/semantic-integrity-chec...