KCL, a constraint-based functional language for configuration
kcl-lang.io
kcl-lang.io
This part scares me a bit. How does it merge? In cuelang, everything has to agree otherwise it's an error. If KCL has a situation where one file can override another, I'm out. That gets way too hairy way too fast.
Edit:
data0 = {id: 1} | {id: 2} # Error:conflicting values between {'id': 2} and {'id': 1}
data1 = {id: 1} | {id = 2} # Ok, the value of `data` is {"id": 2}
There are the foot gunsI would've loved it more if Nix had ability to create custom types, ideally GADTs. Tagged attrsets work for sure, but a better type system would've probably made things easier and nicer.
The ROS parameter system does automatic overwriting of values. You end up with different subsystems loading different param files in the parameter server, with each one overwriting values from the last one. It is a complete nightmare.
State will always err… find a way
KCL also provides a certain degree of immutability, such as ensuring that exported variables are immutable and that configurations in a file cannot be modified. You can only import it and use it to generate new configurations.
In addition, in the cloud native field such as Kubernetes, configuration merging operations can be seen everywhere, such as the built-in JsonMergePatch strategy, Kustomize, and multiple environment configurations for developers. You can find similar corresponding features in KCL.
In fact, KCL also has the idempotent merge operation of cuelang, and languages such as jsonnet, pkl, Nickel also have certain configuration merge capabilities. Only cuelang strictly follows the idempotency of merging, which to some extent limits its use and understanding.
Although it looks like it is a better replacement for HCL (Terraform), I'm thinking this may end up working better than Helm.
However, looking at it now, it falls into the same problems all template generators have. Those are things solved by using general purpose languages generate rather than templating manifests.
KCL is in the middle ground. The Ruby mixins I can use for manifest generation can has an equivalence with KCL's union.
I can see Timoni's appeal as it looks like an improvement over Helm and integrates building artifacts.
https://www.kcl-lang.io/docs/user_docs/getting-started/intro...
https://www.kcl-lang.io/docs/user_docs/getting-started/intro...