A browser-native workbench for building your own programming language.
Implement each stage yourself, inspect every intermediate representation live, export a standalone Rust project.
demo.mp4
desugar is a language implementation workbench. You build a working interpreter from raw text to evaluated output, one pass at a time, inside a browser studio that visualises every intermediate representation as you write it.
Each lesson adds one pass. The pipeline viewer updates live:
Source Tokens Parse Tree Evaluation
let x = 1 + 2; Let "let" LetBinding Integer(3)
Ident "x" name: "x"
Equal "=" value: BinOp
Int "1" left: IntLit(1)
Plus "+" op: "+"
Int "2" right: IntLit(2)
Semi ";"
You name your language, give it a file extension, and choose a CLI name. When you finish, you eject the result as a standalone Rust project with a working CLI, test suite, and sample programmes.
cargo run -p desugar
Open http://127.0.0.1:4001 in your browser.
- Create a profile. Name your language, pick a file extension, choose a CLI name.
- desugar generates a working Rust workspace for your language.
- Work through three lessons in the browser. Each lesson adds one implementation pass.
- The pipeline viewer shows every intermediate representation as you edit.
- Run tests, reveal hints if stuck, benchmark your implementation against tiers.
- When done, eject your language into
exports/as a standalone project.
Lesson 1: Tokenise. Turn raw source text into a stream of tokens. The pipeline viewer shows the token table.
Lesson 2: Parse. Turn the token stream into an expression tree. The viewer adds the AST panel.
Lesson 3: Evaluate. Walk the tree and compute a result. The viewer shows the full pipeline from source to value.
Each lesson builds on the previous. Your language is one codebase that grows.
exports/aster/
Cargo.toml
compiler/
Cargo.toml
src/lib.rs
tests/
cli/
Cargo.toml
src/main.rs
samples/
hello.ast
README.md
A real Rust workspace with your language name, your file extension, your CLI binary, and passing tests.
Most language implementation education stays academic or drops you into a half-built codebase. desugar takes a different path: you build everything from raw text in a live workbench that visualises every pass.
Where desugar is stronger. You build a named, ejectable language. The pipeline viewer gives immediate visual feedback on every implementation pass. Test-driven milestones, progressive hints, and benchmark tiers make progress tangible.
Where desugar is weaker. It covers one language family (expression-based). It does not yet teach type checking, optimisation passes, or backend code generation. Crafting Interpreters covers more ground if you want breadth.
- Browser workbench with lesson progression, guided editing, hints, and scoring
- Live pipeline viewer showing tokens, AST, and evaluation for each pass
- Learner onboarding that creates a personalised language workspace
- Per-test reruns with save, reset, and run-all
- Quality checks (cargo fmt, clippy) with feedback
- Benchmark tiers with bonus points
- Progress persistence across sessions
- Export of the finished language as a standalone repo
Working today: full three-lesson arc, pipeline viewer, workspace generation, quality checks, scoring, persistence, export with CLI.
Not yet implemented:
- Type checking pass
- Name resolution pass
- Module system
- Backend code generation (bytecode VM or Wasm)
- Multiple language tracks beyond expression-based
- Gallery for sharing ejected languages
MIT