# Dhall

Dhall is a programmable configuration language designed as "JSON + functions + types + imports." Its design point is that configuration deserves the same correctness tooling as production code, and that "Turing-complete configuration languages" are the wrong tradeoff. Dhall is a *total* programming language — programs are guaranteed to terminate, with no arbitrary side effects.

## What it gives you

- **DRY configuration** — define a single source of truth and reference it from multiple deploy targets. The same Dhall file converts to YAML or JSON for whatever downstream tool consumes it.
- **Refactoring with semantic hashes** — a Dhall expression's semantic hash is invariant under behavior-preserving refactors, so you can guarantee that a renaming or reorganization didn't change what the configuration actually says. The screencast on the homepage shows the hash unchanged across multiple syntactic rewrites.
- **Semantic diff** — verify that a deliberate change is *only* the change you meant.
- **Editor integration** — type-aware navigation, autocompletion, clickable imports, hover tooltips for inferred types. VSCode support shown in the demo.

## Safety model

Dhall is explicit about supporting untrusted code:

> The language aims to support safely importing and evaluating untrusted Dhall code, even code authored by malicious users. We treat the inability to do so as a specification bug.

The combination of total evaluation (no nontermination), no side effects, and bounded import resolution makes this plausible — adversarial input can fail to typecheck or fail to import, but it can't, by language design, escalate.

## What it competes with

- **YAML/JSON with template languages** (Jsonnet, Helm templates, CUE, ksonnet). Dhall's type system catches errors Jsonnet doesn't.
- **Nix language** for non-NixOS use cases — similar laziness-and-purity instincts, different ergonomics.
- **TypeScript/Pydantic config classes** — Dhall is forge-independent and language-independent, so the same config feeds Go, Rust, Haskell, Python tooling.

The trade is the learning curve. Dhall's type system is sophisticated and the import/hash machinery has its own mental model.

## Where it sits

Adjacent to [[whitelist-capability-config]] — Refaktor's case for default-deny embedded scripting via Rye — but Dhall takes the opposite design choice: a full functional language with strong totality guarantees, not a default-deny minimal one. Both are responses to the same tension between configuration expressiveness and safety. Dhall says "make the language too small to do anything dangerous." Rye says "start from nothing, register capability per word."

Site: [dhall-lang.org](https://dhall-lang.org)
