Configuration as Code, Using PKL
Blog post from Stream
Apple's newly released PKL, a configuration language launched in February 2024, aims to simplify the process of configuring software by providing rich validation and tooling capabilities beyond those offered by traditional static formats like JSON, YAML, and XML. PKL, pronounced "pickle," integrates the concept of Configuration as Code (CaC), enabling developers to express configurations in a text-based format that can be ingested automatically, promoting repeatability and traceability. Unlike static formats, PKL offers features like templating, abstraction, and the ability to define schemas that include constraint-based validations, sensible defaults, and clear error messaging. It is designed to be embedded in codebases, with libraries available for languages like Java, Kotlin, Swift, and Go, allowing for easy integration and documentation generation. PKL promises to address the limitations of existing static formats by providing a syntax that supports comments, documentation generation, and IDE support, positioning itself as a potentially widely adopted tool for handling complex configurations.