The RCL Configuration Language¶
RCL is a domain-specific language for specifying human-written data with just enough abstraction features to avoid repetition. It is a superset of JSON that extends it into a simple functional programming language that resembles Python and Nix. Use cases include:
- Querying JSON documents, like
jq
, but with a more familiar language. - Generating repetitive configuration files, such as GitHub Actions workflows or Terraform configuration.
- Sharing configuration between tools that do not natively share data. For example, import the same user account definitions into Terraform, Tailscale, Kubernetes, and Ansible.
RCL can be used through the rcl
command-line tool that can export documents to JSON, YAML, TOML, and other formats. It can also be used through a native Python module, with an interface similar to the json
module.
Example¶
// Configuration that defines cloud storage buckets for storing backups of two
// databases, "alpha" and "bravo", at three different frequencies. This schema
// is for a hypothetical infrastructure-as-code tool. See the tutorial for more
// details.
{
backup_buckets = [
let retention_days = { hourly = 4, daily = 30, monthly = 365 };
for database in ["alpha", "bravo"]:
for period, days in retention_days:
{
name = f"{database}-{period}",
region = "eu-west",
lifecycle_policy = { delete_after_seconds = days * 24 * 3600 },
}
],
}
For an interactive demo in your browser, see https://rcl-lang.org.
Status¶
RCL is a hobby project without stability promise. It is usable and useful, well-tested, and well-documented, but also still experimental, and it may have breaking changes. Syntax highlighting is available for major editors like Vim, Emacs, Helix, and Zed.
License¶
RCL is free/libre software, licensed under the Apache 2.0 license. The project is developed in the open and the source code is available on GitHub and Codeberg.