$ dhall-c — one C source, two targets

A Dhall subset, written in C

Typecheck, normalize, and serialize Dhall configuration. The same C interpreter ships two ways: a single native binary that runs on every major OS, and a WebAssembly build that runs right here in your browser.

Compiled once for C. Delivered two ways.

// one source · two targets

The same lexer, parser, normalizer, and typechecker (src/*.c) build into two artifacts that cover the entire spectrum — from your terminal to a browser tab.

src/*.c  — the interpreter · lexer · parser · normalize · typecheck · serialize · import
├─ src/main.c  → cosmocc    → dhall.com   one binary, many OSes
└─ src/wasm.c  → emscripten → dhall.wasm  zero-install, in your browser
01

Native binary — dhall.com

A single self-contained ~1 MB Actually Portable Executable built with cosmocc. The same file runs natively on Linux, macOS, Windows, and the BSDs — no VM, no runtime, no recompile.

02

In the browser — dhall.wasm

The same interpreter compiled to a 122 KB .wasm module. It runs 100% client-side — no server, no upload.

Try it live. The playground runs the real interpreter (and the real LSP) in your browser.
Open the Playground →

A capable Dhall subset

// single-term de Bruijn core, eager normalization, bidirectional typechecking
typecheck

Bidirectional inference

Precise Error: … at line N, col M diagnostics.

normalize

Eager, step-sound

Normal forms re-parse and round-trip.

arbitrary precision

Big naturals & integers

Unbounded Natural and Integer — no overflow, Natural subtraction saturates at 0.

imports

File, env, and http

Local file imports, env: imports, and http:// URLs with mandatory sha256: hashes and ? fallback.

serializers

JSON · TOML · YAML

One evaluated value tree renders to all three from the same shared representation.

records & unions

merge, toMap, with

Recursive /\ merge, right-biased //, with updates, and the empty record.

assert

Type-level checks

Enforced in every mode — typecheck, normalize, and all three serializers.

unicode

Unicode operators

λ → ∀ ∧ ⫽ ≡ accepted alongside their ASCII spellings.