A generic incremental parser framework for MoonBit — edit-aware lexing,
a lossless green tree (CST), subtree reuse, error recovery, and a
reactive pipeline. Any grammar plugs in via a single
Grammar[T, K, Ast] value.
New here? Start with the dowdiness/loom package README
for the API and a Quick Start, then browse the docs index.
Core framework (stable):
| Module | Path | Purpose |
|---|---|---|
dowdiness/loom |
loom/ |
Parser framework: incremental parsing, CST building, grammar composition |
dowdiness/seam |
seam/ |
Language-agnostic CST infrastructure (CstNode / SyntaxNode) |
dowdiness/incr |
incr/ |
Salsa-inspired reactive signals / memos |
Sibling modules (see each module's README for scope and status):
| Module | Path | Purpose |
|---|---|---|
dowdiness/pretty |
pretty/ |
Wadler-Lindig pretty-printer (generic Layout[A], annotations) — used by examples/json |
dowdiness/egraph |
egraph/ |
Equality graph for equality saturation |
dowdiness/egglog |
egglog/ |
Relational e-graph engine (Datalog + equality saturation) |
dowdiness/text_change |
text-change/ |
Pure contiguous text-change utilities (migrated from canopy 2026-05, #147) |
dowdiness/moji |
moji/ |
UAX #29 grapheme cluster + word boundary segmentation, UTF-16 indexed (migrated from canopy 2026-05, #147) |
| Example | Path | Purpose |
|---|---|---|
| Lambda Calculus | examples/lambda/ |
Reference grammar — typed SyntaxNode views, error recovery, CRDT exploration |
| JSON | examples/json/ |
Step-based prefix_lexer + block_reparse_spec — exercises every Grammar::new option |
| Markdown | examples/markdown/ |
Mode-aware lexing via ModeLexer — line-start / inline / fenced code contexts |
Monorepo — every module is an independent MoonBit package, so run
moon from the module directory:
git clone https://github.com/dowdiness/loom.git
cd loom
(cd loom && moon test) # framework
(cd examples/lambda && moon test) # lambda example
(cd examples/lambda && moon bench --release)Multi-module development workflow: docs/development/managing-modules.md.
- docs/README.md — navigation index (start here, architecture, API, archive)
- ROADMAP.md — phase status and future work
- CHANGELOG.md — user-facing changes