XRAPH/Work/Expression language
Go · since 2026

DTL

A small embeddable expression and function language for Go, readable by analysts and safe to evaluate on untrusted input. Immutable bindings, pattern matching and a pipe operator, with the host supplying the vocabulary of whatever domain it is embedded in.

Language
Go
Category
Expression language
Since
2026
Stars
0
Repository Docs
01

Highlights

3 claims
H.01
Immutable
Bindings, once made

A let cannot be reassigned, which is what makes a function free of side effects and safe to evaluate in parallel.

H.02
Ninetypes
Plus array variants

string, int, float, bool, datetime, duration, object, any and void, annotated at the declaration and checked there.

H.03
Sandboxed
Safe on untrusted input

No side effects by default, with depth and timeout limits, so evaluating a function somebody else wrote is a bounded operation.

02

The language

9 entries
Language specification

What the specification defines, and where it deliberately stops. Datastores, HTTP and message buses are the embedding host’s to register.

02.1
Declaration

Functions, one line or many

A function takes typed parameters with optional defaults and a trailing variadic, and returns a declared type. The arrow form carries a single expression and the colon form carries a body, so a one-liner never has to grow braces to become readable.

DefaultsVariadic
Declarations
02.2
Bindings

Immutable by construction

A let binds once. There is no assignment operator to reach for, so a function has no side effects to reason about and the evaluator is free to run calls in parallel.

let
02.3
Control flow

Conditionals and pattern matching

An inline if is an expression and chains into an else-if ladder. A match arm tests a comparison, a literal, a range or a wildcard, which covers the classification shape these functions are mostly written for.

matchRanges
02.4
The pipe

Chained in reading order

The pipe operator chains transformations in reading order, so a filter, an average and a rounding compose as three steps instead of three nested calls. It is the piece of syntax that makes the rest readable to somebody who does not write code for a living.

|
02.5
Collections

Map through group_by

map, filter, reduce, sort, head, tail, unique, flatten, zip, group_by and chunk, all shaped to pipe. A filter accepts an implicit argument, so a comparison alone is a valid predicate.

Pipe-shaped
02.6
Aggregation

Twelve reducers

sum, avg, min, max, count, stdev, variance, median and percentile, plus count_where and sum_where for the conditional cases that otherwise need a filter first.

Percentile
02.7
Errors

Degrade, or say nothing happened

try and catch fall back to a value. Null coalescing and optional chaining handle the absent-field case without a nested conditional at every access.

???.
02.8
Namespaces

Stable fully-qualified names

Functions live under system, shared, team, user or app namespaces, so a name is both an access-control decision and something that stays valid when the function is shared.

Versioned
02.9
Standard library

Five namespaces, all pure

system::math, system::text, system::datetime, system::stats and system::collections ship preloaded. Every one of them is written in DTL itself, which is the honest test of whether the language is expressive enough.

Written in DTL
Standard library
The full specification
03

Anatomy

4 modules
01

Lexer and parser

Source to AST, with the indentation rules that let a function body skip braces.

02

Type system

Nine scalar types plus array variants, checked at declaration.

03

Evaluator

Sandboxed, with depth and timeout limits on every call.

04

Standard library

Five pure namespaces under system::, none of which reach outside the interpreter.

04

Why it exists

Design notes

A small embeddable expression and function language for Go, readable by analysts and safe to evaluate on untrusted input. Immutable bindings, pattern matching and a pipe operator, with the host supplying the vocabulary of whatever domain it is embedded in.

05

Signals

GitHub
Stars
0
Language
Go
Since
2026
Adopters
00

Shipping something on DTL? Nobody is listed here yet. Tell me what you built and you will be the first.

Get listed
06

Where it sits

Fields · papers