Quilt Documentation
Quilt lets metaprograms in any language generate and manipulate code in any other language using five Unicode arrow glyphs.
A .quilt file is ordinary source code with Quilt brackets spliced in. Running quilt expand strips the brackets and writes plain source — no special build system required.
// squares.py.rs.quilt — a Rust program that generates Python
let squares: Vec<u64> = (1..=5).map(|n| n * n).collect();
let program = python↖
def main():
squares = ↙squares.↑↘
print(squares)
main()
↗;
println!("{}", program.coparse());
# generated squares.py
def main():
squares = [1, 4, 9, 16, 25]
print(squares)
main()
The five operators — quote ↖↗, unquote ↙↘, lift ↑, reduce ↓, emit ← — compose across any combination of supported languages. See Concepts for a full walkthrough.
Start here
- Concepts — the file format, all five operators, and how staging works
- CLI & Scripts —
quilt expand,quilt run, and the helper scripts - Editor Setup — VS Code extension with glyph keybindings and LSP support
Language
| Page | What it covers |
|---|---|
| Concepts | The .quilt file format, operator glyphs, quasi-quoting, and staging |
Tooling
| Page | What it covers |
|---|---|
| CLI & Scripts | quilt expand, quilt run, and the bin/ helper scripts |
| Python Bindings | quilt_python — the PyO3 runtime for .py.quilt files |
| Quilt LSP | quilt-lsp — the multiplexing Language Server |
| Editor Setup | VS Code extension, keybindings, and tools/quilt |
Internals
Reference material for contributors and anyone extending Quilt.
| Page | What it covers |
|---|---|
| QTerm IR | The central QTerm data type and the QTermBuilder fluent API |
| Parse → Expand Pipeline | How a .quilt file becomes ordinary source code |
| Language Traits | Language, LanguagePost, MetaLanguage — the extension points |
| Concrete Languages | Rust, Python, HTML, WGSL, Zsh, Bash, Text implementations |
| Multi and Omni | The Multi<LS,MS> engine and the Omni production registry |
| Bootstrap | Self-hosting: generating meta.rs from mk_meta.rs.quilt |
| Adding a Language | Step-by-step guide for supporting a new language |
| Nanobots | The gas-metered nanobot IR toolchain (sibling repo) |
Repository layout
quilt/
├── quilt/ # Core library + CLI
├── quilt-lsp/ # Language Server
├── quilt-python/ # PyO3 bindings (Python runtime)
├── tree-sitter-quilt/ # Grammar for the Quilt bracket syntax
├── bin/ # Helper scripts: quilt, bootstrap, build-py, …
├── tools/quilt/ # VS Code extension
├── docs/wiki/ # This wiki
└── examples/ # Annotated .quilt examples