Dyadic (dyadic-lang) is a general-purpose, capability-oriented programming language built around a single portable intermediate representation (dyadic.ir/1).
Pure functions (fn), effectful functions (fx), durable concurrent workflows (workflow), algebraic types and pattern matching, bytecode execution (dyadic.bc/1), WebAssembly 1.0 compilation, selective content-addressed replay, and fail-closed Black Box audit evidence all operate over the same canonical IR.
Licensed under the Apache License, Version 2.0.
Instead of stitching together separate tools for type checking, sandboxing, workflow orchestration, bytecode/Wasm execution, and audit trails, Dyadic unifies them through one compiler frontend and one canonical IR:
- Canonical IR as Source of Truth (
dyadic.ir/1): Type, effect, and taint checks run before lowering to canonical IR (.dyc). Optimization (--opt), VM bytecode compilation (internal/vm), WebAssembly 1.0 emission (internal/wasm), workflow scheduling (internal/runtime), selective replay (internal/replay), and Matrix/POG interoperability (internal/interop) all consumedyadic.ir/1. - Purity and Explicit Capabilities (
fnvs.fx/workflow): Purefndeclarations cannot invoke host effects or read ambient external state. Effectful operations must declare capabilities (cap) with ordered risk levels (read < safe < mutate < danger), explicit signatures (with [...]), resource scopes (hosts,paths,commands), and runtime attenuation via.dyspolicy rules. - Static Taint Boundaries (
Tainted<T>): Untrusted inputs carryTainted<T>and cannot flow into mutating or dangerous sinks withoutverify(...)or explicitrequire approval(...)gates. - Multiple Verified Targets: Execute workflows directly on the DAG scheduler, compile pure code into
dyadic.bc/1stack bytecode, emit standalone WebAssembly 1.0 binaries with linear memory (--target wasm), or export pure subsets to.dmand/v1/pog. - Write-Ahead Black Box Evidence: In
enforcemode withaudit write_ahead, mutating operations record RFC 8785 UTF-16 canonical JSON envelopes chained via SHA-256 and signed with Ed25519 checkpoints (dyadic.blackbox.bundle/1). - Self-Hosted Compiler (
std.compiler):std/selfhost.dyandstd/compiler.dytokenize, validate purity, resolve workflow dataflow$futuredependencies, and emit schema-validdyadic.ir/1JSON executable across the VM, workflow runtime, and Wasm 1.0 (tested through Stage 2 self-compilation).
| Area | Available in v0.2.0 | Planned Roadmap |
|---|---|---|
Core language (fn, fx, workflow, structs, enums, maps, generics, lambdas, ?, loops, match, test) |
Implemented | Ongoing ergonomics and richer diagnostics |
Portable IR (dyadic.ir/1) and --opt IR optimizer |
Implemented | Whole-program specialization and link-time optimization |
| Execution targets | Go DAG runtime, dyadic.bc/1 VM, WebAssembly 1.0 |
Native AOT .dyl codegen backend (extension reserved in ADR-0002) |
Capability security and Tainted<T> enforcement |
Static compile checks + runtime leases + .dys policy rules |
Fine-grained effect polymorphism and low-level memory region controls |
| AI and agent abstractions | Optional first-class role, agent, budget, within, agent.run primitives |
Pluggable inference providers and distributed worker transport |
| Developer tooling | CLI, --opt IR optimizer, REPL, stdio LSP, formatter, TextMate grammar |
Editor extensions and package registry workflows |
General-purpose programs and WebAssembly modules require no AI roles or model configuration to compile or execute.
- Go 1.26+ (zero third-party Go module dependencies)
- Node.js 24+ (optional, for executing compiled
.wasmtests)
go install github.com/DyadicOrg/dyadic-lang/cmd/dyadic@v0.2.0
dyadic versionOr build directly from a clone:
git clone https://github.com/DyadicOrg/dyadic-lang.git
cd dyadic-lang
go build -o dyadic ./cmd/dyadic
./dyadic versionPre-built binaries and SHA256SUMS.txt are published on GitHub Releases for Linux (amd64, arm64), macOS (amd64, arm64), and Windows (amd64, arm64).
./dyadic test examples/wasm-math
./dyadic build examples/wasm-math --target wasm -o build/math.wasm
./dyadic build examples/wasm-math --target vm -o build/math.dybc
./dyadic run build/math.dybc --graph fib --param n=10./dyadic check examples/research-agent
./dyadic test examples/research-agent
./dyadic build examples/research-agent --target ir -o build/research.dyc
./dyadic run build/research.dyc \
--sandbox ./sandbox \
--approve \
--param url=https://dyadic.app/docs \
--bundle build/research.bundle.json
./dyadic verify build/research.bundle.json./dyadic init my-app
cd my-app
../dyadic check .
../dyadic build -o build/my-app.dyc .
../dyadic run build/my-app.dyc.dy: Primary Dyadic source files (fn,fx,workflow,type,enum,cap,role,agent,budget,test).dyt: Contract and type interfaces (bodyless signatures, structs, enums, capabilities, roles).dyw: Standalone workflow files.dyp: Package and skill bundle declarations (package,version,requires).dys: Runtime and policy defaults (system,mode,audit,budget,allow,ask,deny).dyc: Compiled canonicaldyadic.ir/1artifact (program,library, orworkflow).dyl: Reserved per ADR-0002 for future native OS library linking
dyadic check <path>: Parse and run type, capability, taint, and policy checksdyadic build [--target ir|vm|wasm] [--opt] [--lock] [-o path] <path>: Compile to.dyc,.dybc, or.wasmdyadic run [--vm] [--opt] [--graph name] [--param k=v] [--sandbox dir] [--approve] [--shell] [--bundle path] [--trace path] <path>: Run source,.dyc, or.dybcdyadic test <path>: Execute embeddedtest "..." { ... }blocksdyadic disasm [--opt] <path>: Disassemble pure functions intodyadic.bc/1bytecode instructionsdyadic inspect [--schema] [--opt] <path>: Print IR/bytecode summary, capabilities, and budgetsdyadic verify [--schema] <path>: Verify a Black Box evidence bundle or IR/evidence schema conformancedyadic replay --prev <a.dyc> --trace <trace.json> --next <b.dyc>: Compute content-addressed selective replay plan and re-run safelydyadic export-pog [--submit url --token bearer] <path>: Export workflow DAG as adyadic.pog.plan/1manifestdyadic matrix-check <path>/dyadic matrix-export [-o out.dm] <path>: Check and export deterministic pure subsets as Matrix (.dm)dyadic fmt [--check] <path>: Format.dy,.dyt,.dyw,.dyp,.dyssource filesdyadic lsp: Run stdio Language Server Protocol server (diagnostics, hover, definitions, dot-completions)dyadic repl: Interactive expression, declaration, type, and bytecode shelldyadic init [dir]: Initialize a new Dyadic project (dyadic.toml,dyadic.lock,src/main.dy)dyadic version: Print toolchain and IR/bytecode/evidence schema versions
cmd/dyadic/: CLI, REPL,--optand Stage 2 self-hosting bootstrap testsinternal/lexer/,internal/ast/,internal/parser/: Lossless lexer, typed AST, and parserinternal/types/: Type inference, generics, purity, capability subset, andTainted<T>checkerinternal/ir/: Canonicaldyadic.ir/1representation, builder, digests, and--optIR optimizerinternal/runtime/: Concurrent DAG scheduler, pure evaluator, capability leases, budgets, and durability ledgerinternal/vm/: Stack bytecode compiler and bounded VM (dyadic.bc/1)internal/wasm/: Standalone WebAssembly 1.0 compiler with linear memory and runtime helpersinternal/replay/: Content-addressed selective replay analyzer and re-executorinternal/blackbox/: RFC 8785 UTF-16 canonical JSON, salted commitments, and Ed25519 bundle verifierinternal/interop/: JSON Schema validators,/v1/pogexporter, and Matrix (.dm) parity bridgeinternal/format/,internal/lsp/,internal/project/: Code formatter, stdio LSP, and manifest/lockfile loaderstd/: Embedded standard library (core.dyt,math.dy,collections.dy,text.dy,verify.dy,selfhost.dy,compiler.dy)schemas/: JSON Schemas (ir.schema.json,evidence.schema.json)editor/syntaxes/: TextMate grammar for.dy,.dyt,.dyw,.dyp,.dysdocs/: Language Spec, Core IR Spec, Architecture, and ADRsexamples/: Runnablehello,research-agent, andwasm-mathworkspaces
gofmt -l .
go vet ./...
go test -count=1 ./...
go run ./cmd/dyadic test std
go run ./cmd/dyadic test examples/hello
go run ./cmd/dyadic test examples/research-agent
go run ./cmd/dyadic test examples/wasm-math
go run ./cmd/dyadic fmt --check examples std- See CONTRIBUTING.md for development guidelines and architectural invariants.
- See SECURITY.md for private vulnerability reporting and security boundaries.