UniversalToolchain & Wist

Build DSLs on .NET from reusable compiler modules.

UniversalToolchain is reusable language infrastructure, not “just another language.” Wist is the reference implementation that proves the architecture with a working CLI, REPL, dialect composition, and dual execution backends.

Modular pipeline CLI + programmatic API Dialect-driven runtime composition
4CLI verbs
2execution modes
3dialect profiles
.NET 10runtime baseline
Wistreference language

Compose features

Assemble language behavior from modules such as arithmetic, variables, loops, and conditions.

Choose execution

Run in interpreter mode for debugging and in compiler mode for compiled execution with the same language frontend.

Define dialects

Declare language/runtime profiles in a .wistdialect file, compose a host, then execute through the same CLI/programmatic path.

Why this exists

Many DSL projects rebuild the same plumbing repeatedly: lexer/parser, AST transforms, runtime wiring, and execution. UniversalToolchain exists to reuse that infrastructure through composable .NET stages and modules.

Instead of hardcoding one runtime, you compose capabilities, keep one frontend model, and switch execution paths with explicit dialect/runtime settings.

What works today

Current capabilities are production-minded building blocks, not placeholders.

Wist CLI with verbs: run, repl, dialect-inspect, dialect-demo
REPL for interactive execution
Programmatic execution API via WistDialectExecutionWorkflow
Dialect-based runtime composition from .wistdialect files
Two runtime modes: compiler and interpreter
Runnable example dialect profiles and programs in-repo
Core tests plus dedicated dialect tests

Dialect examples (language/runtime profiles)

One framework → multiple profiles. Same toolchain, different capability sets and runtime shape.

full-default

broader profile

Practical default-style Wist profile close to regular execution.

loopsconditionsvariableslabels
Real example
let sum = 0
for (let i = 1) (i <= 5) (i = i + 1) (
    sum = sum + i
)
sum
  • Modules include arithmetic, conditions, loops, variables, scopes, labels, and more.
  • Backends: cil + interpreter.
  • LocalVariablesOptimization enabled.
  • Returns 15.

minimal-arithmetic

narrow profile

Smallest useful arithmetic-oriented composition.

arithmeticnumbersscopes
Real example
2 + 3 * 4
  • Modules: Arithmetic, Numbers, Scopes, Whitespaces.
  • Backend: interpreter.
  • Returns 14.

restricted-sandbox

most constrained

Constrained profile for narrower capabilities.

interpreter onlyno variablesno conditions
Allowed vs forbidden

Allowed example

40 + 2

Forbidden example

let x = 1
x
  • Interpreter only; excludes variables, conditions, loops, and interop-related capabilities.
  • Allowed example returns 42.
  • Forbidden example fails by design (variables are excluded here).
  • Not a hardened sandbox guarantee.

What changes when you change modules?

full-default
Real example uses variables + loop and computes the sum `1..5` → returns `15`.
minimal-arithmetic
Real example is expression-only arithmetic: `2 + 3 * 4` → returns `14`.
restricted-sandbox
Allowed arithmetic `40 + 2` works, but `let x = 1` fails by design.

How it works

Stage 1

Source

Wist program source enters the pipeline.

Stage 2

Frontend

Lexer/parser build syntax and AST from the source.

Stage 3

IR / Bytecode

AST is lowered into bytecode-style intermediate form.

Stage 4

Optimization

Configured optimization passes refine the intermediate representation.

Stage 5

Backend + Execution

Compiler or interpreter path runs with dialect/runtime composition.

For programmers

UniversalToolchain composes language behavior across multiple stages (frontend through runtime). Wist demonstrates shared frontend concepts with dual backends.

Dialect workflow: parse dialect source → build semantic plan → resolve runtime composition → create host → run code.

You can execute through CLI entry points or use WistDialectExecutionWorkflow directly in .NET code. The repository includes runnable examples and tests for both core and dialect paths.

Limitations and trust model

This repository does not claim hardened sandboxing for untrusted code. Constrained dialect composition is not equivalent to OS/process-level isolation. Treat untrusted execution as high risk.

Architecture and composition ergonomics are still evolving. Active engineering work includes deterministic composition, intrinsic governance, compiler/interpreter semantic parity, and reducing mutable-state risks in long-lived execution flows.