Two key considerations drove the choice to use CUE:
Declarative Code Generation
hof
uses code generators defined in CUE, combining data and templates to generate files.
With CUE as the source of truth, we gain consistency for inputs and mappings, allowing
composable generators to generate code across languages and technologies.
hof
allows you to define the declarative schemas to code generators and package them into reusable modules.
Purpose-Built for Large-Scale Configuration
CUE has a strong foundation and robust tooling for managing configuration across multiple files, packages, and modules.
CUE's logical nature ensures that the configuration is both efficient and correct.
Since hof
's inputs are typically declarative configurations, CUE is a natural fit throughout the process.
Other benefits of CUE include:
For those unfamiliar with CUE, Bitfield Consulting has a great
Introduction to CUE from a JSON perspective.
It is a quick read and provides an excellent foundation for using CUE with hof
.
To further your CUE knowledge, be sure to check out these resources:
a: "foo"b: bool | *true