Contributing to the compiler
This section is for people working on Bynk itself — the bynk compiler and its
sibling tools — rather than people writing Bynk programs. If you are here to
use Bynk, start with the tutorials.
The repository
Section titled “The repository”Bynk is a Cargo workspace plus a JavaScript project (the tree-sitter grammar). The VS Code extension lives in its own repository, bynk-lang/vscode-bynk:
| Crate / project | What it is |
|---|---|
bynk-syntax, bynk-check, bynk-emit | The compiler: lex → parse → resolve → check → emit. |
bynk | The CLI (bynk), over bynk-driver’s command bodies. |
bynk-fmt | The formatter, a leaf over bynk-syntax. |
bynk-lsp | The language server (bynk-lsp), built on tower-lsp. |
tree-sitter-bynk | The grammar (grammar.js → generated parser) and highlight queries. |
The workspace targets the Rust 2024 edition.
Build and test
Section titled “Build and test”cargo build # build all workspace cratescargo test # run the whole Rust test suitecargo test -p bynk-tests # the integration corpus (one `it` binary)cargo test -p bynk-tests runs, among others:
- the fixture suite (
tests/e2e.rs) — the heart of the compiler’s tests; - the
tscverification gate (tests/tsc_verify.rs); - the generated-reference checks and the doc-example gate for the book.
See Testing & fixtures for how these work and how to update them.
A few conventions
Section titled “A few conventions”BYNK_BLESS=1is the project-wide “regenerate expected output” switch. It re-blesses fixture expectations and the generated reference pages. Run it deliberately and review the diff.- The spec is the source of truth; the design notes are rationale. The
normative spec under
site/src/content/docs/reference/spec/defines the current language and is updated per increment; the decisions behind increments live indesign/decisions/. The remainingdesign/*.mdnotes are rationale and history — some are aspirational or predate the Rust rewrite. Trust the fixtures and the code for current behaviour. - Docs ship with the feature. Each increment updates the book in the same change — see Working on the docs.
Where to look
Section titled “Where to look”- Compiler architecture — the pipeline and the crates.
- Testing & fixtures — the fixture formats, the bless workflow, the
tscgate. - Working on the docs — the book, its generators, and its guardrails.