A metalanguage for creating sophisticated DSLs in Racket. You provide a grammar and binding rules, and the metalanguage provides a front-end that checks binding, expands macros to your DSL core langauge, and provides tools for working with binding in your DSL's compiler.
syntax-spec
is used in the Qi, hosted-minikanren, and ocular-patdown projects.
This repository also includes a number of example DSL implementations: peg, cmdline, miniKanren, miniclass, and TinyHDL. There is also a small state machine DSL.
If you'd like to learn more about syntax-spec, you can check out our ICFP 2024 paper and associated 15-minute talk, or my longer demo at the 2024 miniKanren workshop.
A release is available on the Racket package server as syntax-spec-v2
.
This is still a prototype: future releases will likely contain breaking changes, and the documentation is incomplete. However, breaking changes will be released under an updated package name.
To use the released package, install via:
raco pkg install syntax-spec-v2
and import as
(require syntax-spec-v2)
Its documentation is available on the Racket documentation site.
To use the latest, unstable version, check out the Git repository, change directory into it, and run:
raco pkg install
Then import as
(require syntax-spec)
Once installed, you can access the documentation via:
raco docs syntax-spec