Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 17, 2026·3 min de lecture

Dhall — Programmable Configuration Language with Guarantees

A non-Turing-complete configuration language that guarantees termination, is strongly typed, and can generate JSON, YAML, and other formats from a single source of truth.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Dhall Overview
Commande d'installation directe
npx -y tokrepo@latest install 9f778220-81dd-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Dhall is a programmable configuration language designed to replace hand-written JSON, YAML, and TOML files. It provides functions, types, and imports while guaranteeing that every Dhall expression terminates — there are no infinite loops or unbounded recursion. This makes it safe to evaluate untrusted configuration code.

What Dhall Does

  • Generates JSON, YAML, TOML, Bash, and other formats from typed Dhall expressions
  • Provides functions, records, unions, and generics for DRY configuration
  • Guarantees termination — every Dhall program finishes in finite time
  • Supports remote imports with integrity checking via SHA-256 hashes
  • Catches configuration errors at evaluation time with a strong type system

Architecture Overview

Dhall is a total functional programming language — it deliberately excludes Turing-complete features like general recursion. The evaluator normalizes expressions (resolving imports, applying functions, and reducing terms) to produce a final value that is then serialized to the target format. The type checker runs before evaluation and ensures all expressions are well-typed. Remote imports are fetched over HTTPS and can be pinned to a specific hash for reproducibility.

Self-Hosting & Configuration

  • Install the dhall binary and format-specific tools (dhall-to-json, dhall-to-yaml) via Homebrew or GitHub releases
  • Bindings and integrations are available for Haskell, Rust, Go, Kotlin, Ruby, and Python
  • Use the Dhall Prelude (a standard library) for common patterns like list manipulation and optional handling
  • Pin remote imports with integrity checks: https://example.com/config.dhall sha256:abc123...
  • IDE support via a Language Server Protocol implementation for VS Code and other editors

Key Features

  • Guaranteed termination prevents runaway evaluation of configuration code
  • Strong static type system catches typos, missing fields, and type mismatches before deployment
  • Functions and imports enable shared, reusable configuration modules
  • Integrity-checked remote imports make configuration composable across repositories
  • Standard formatting tool (dhall format) ensures consistent style

Comparison with Similar Tools

  • Jsonnet — Turing-complete templating; Dhall guarantees termination and has stronger types
  • CUE — constraint-based config language; Dhall uses functions and types rather than unification
  • Pkl — Apple's config language; Dhall predates it and provides formal termination guarantees
  • HCL (Terraform) — domain-specific for IaC; Dhall is a general-purpose config language
  • YAML with anchors — limited reuse via anchors; Dhall offers full functions and type checking

FAQ

Q: Why does termination matter for configuration? A: It means you can safely evaluate Dhall config from any source without risking an infinite loop. CI/CD pipelines and build systems benefit from this guarantee.

Q: Can Dhall replace Helm charts? A: Yes. The dhall-kubernetes project provides typed Kubernetes resource definitions that generate YAML manifests.

Q: Is Dhall Turing-complete? A: No, by design. It trades general recursion for the guarantee that every expression finishes evaluating.

Q: How do I start if my project uses JSON/YAML today? A: Use dhall-to-json or dhall-to-yaml to output your existing formats. You can migrate incrementally by replacing one config file at a time.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires