city = {
"id": 3,
"name": "Foo",
"lat": 3.555,
"long": 4.11,
}
Is the same as: city = {
"id": "3",
"name": "Foo",
"coordinates": [3.555, 4.11]
}
But you want to normalize that.Something like Cuelang will:
- Define the schema that will let you know what you should put inside.
- Allow you to inflate that schema into a full file, providing only the values.
- Will generate always a correct file, with no typo, or format error.
- Will check that the data is correct and tell you if there are any errors.
- Is note theoretically tied to a particular run time or stack.
I'll be looking into cue, but how does it solve that problem ?
Similar to why do we write Python instead of assembly, or why do relational databases typically have things like datatypes and constraints?
This is most useful when dealing with tools like k8s where deploying a single application might involve 3-10 separate manifests (Deployment, Service, NetworkPolicy, HttpRoute, Autoscaler etc etc). With Pkl you can easily write a simple template that only requests the minimum needed to define an “app” (e.g. name, namespace, mixins for sidecars) and have Pkl generate all the needed manifests for you.
Really Pkl should be seen as a language for quickly building templating tools like Helm. But with type safety by default, and no need for horrible indent hacks.