CUE is a [[Apache v2]] licensed configuration language written in [[Go]].
- [Website](https://cuelang.org/)
- [GitHub](about:blank)
- Documentation
- AlternativeTo
> CUE merges the notion of schema and data. The same CUE definition can simultaneously be used for validating data and act as a template to reduce boilerplate. Schema definition is enriched with fine-grained value definitions and default values. At the same time, data can be simplified by removing values implied by such detailed definitions. The merging of these two concepts enables many tasks to be handled in a principled way.
# Notability
One of those weird Google things. It's like [[HCL]] on PCP and mixed with [[ProtoBuf]].
## Implementations
The reference implementation (and probably the only implementation) is written in Go.
# Philosophy
I don't even know what is going on here.
> CUE does not distinguish between values and types. This is a powerful notion that allows CUE to define ultra-detailed constraints, but it also simplifies things considerably: there is no separate schema or data definition language to learn and related language constructs such as sum types, enums, and even null coalescing collapse onto a single construct.
This sounds like "Everything is a string, you figure it out later"?
In typical googler fashion, this supposedly simple configuration language is almost 80k lines of code. Documentation is heavy on philosophy, light on practicality. And brags about the horrific conditions it can survive under.
> The graph unification model CUE is based on was in common use in computational linguistics at that time and was successfully used to manage grammars and lexicons of over 100k lines of declarative definitions. These were effectively very large configurations of something as irregular and complex as a human language. A property of these systems were that the types, or constraints, one defines validate the data while simultaneously reducing boilerplate. Overall, this approach seemed to be extremely well-suited for cloud configuration.
That sounds concerning.
# OS Support
# Features
# Example
It looks like [this](https://cuelang.org/docs/usecases/configuration/):
```cue
#Spec: {
kind: string
name: {
first: !="" // must be specified and non-empty
middle?: !="" // optional, but must be non-empty when specified
last: !=""
}
// The minimum must be strictly smaller than the maximum and vice versa.
minimum?: int & <maximum
maximum?: int & >minimum
}
// A spec is of type #Spec
spec: #Spec
spec: {
knid: "Homo Sapiens" // error, misspelled field
name: first: "Jane"
name: last: "Doe"
}
```
# Tips
# References
```cardlink
url: https://cuelang.org/docs/about/
title: "About"
description: "How did CUE come about and what are its principles."
host: cuelang.org
favicon: https://cuelang.org/favicons/favicon-16x16.png
```