Branchline DSL Documentation¶
Branchline is a Kotlin-based DSL for transforming structured data. These docs cover language features, guides, and an interactive playground. For a formal reference, see the language grammar.
What is Branchline?¶
Branchline is a compact language for reshaping structured data (JSON, XML, more coming) with built-in tracing. It aims for clarity, composability, and debuggability while remaining fast across JVM and JS runtimes.
Try it now¶
- Open the embedded playground and load an example such as
customer-profileorpipeline-health-gating. - Toggle tracing to see
EXPLAIN(...)output; edit JSON/XML input and rerun with Cmd/Ctrl + Enter. - Use
?example=stdlib-hof-overview(or any ID) in the URL to preload a scenario.
Quickstart (local)¶
# 1) Clone and verify toolchain
git clone https://github.com/ehlyzov/branchline-public.git
cd branchline-public
./gradlew --version
# 2) Run a Branchline program on JVM
./gradlew :cli:runBl --args "path/to/program.bl --input sample.json"
# 3) Run via Node
./gradlew :cli:jsNodeProductionRun --args="path/to/program.bl --input sample.json"
Use Branchline in your project¶
- CLI (JVM/Node): Use the Gradle helpers above during development or CI. Keep your
.blscripts in your repo and call the CLI from your build/test steps. - JS tarball:
./gradlew :cli:packageJsCliproducescli/build/distributions/branchline-cli-js-<version>.tgz. Add it to your build artifacts, unpack it in CI, and runbin/bl.cjswith--input/--input-format. - Vendoring: You can vendor the packaged CLI into your own tools or Docker images; no Maven/npm packages are published yet, so bundling the tarball (or building from source) is the current path.
Simplest program¶
Run it on JVM: Or on Node:Language highlights¶
- Straightforward data paths:
$orINPUTto navigate payloads; dot, slice, predicate, wildcard support. - Built-in tracing:
EXPLAIN,CHECKPOINT, andASSERTsurface provenance. - Rich stdlib: arrays, aggregation, text utilities, higher-order functions, time, and shared-memory helpers.
- Multiplatform parity: JVM and JS runtimes share the same interpreter/VM code.
Learn the language¶
- Start with the Language Overview and the Getting Started guide.
- Explore the standard library pages for runnable examples linked to the playground.
- Use the playground to tweak code and inputs without installing anything.
What you can build¶
- Normalize XML test reports into JSON summaries and badges.
- Enrich customer/order payloads with fallbacks and computed fields.
- Gate deployments using CHECKPOINT/ASSERT plus traces.