Contributing to the compiler
This section is for people working on Bynk itself — the bynkc 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 two JavaScript/TypeScript projects:
| Crate / project | What it is |
|---|---|
bynkc | The compiler and CLI (bynkc): lex → parse → resolve → check → emit. |
bynk-fmt | A thin crate re-exporting the formatter from bynkc::fmt. |
bynk-lsp | The language server (bynkc-lsp), built on tower-lsp. |
tree-sitter-bynk | The grammar (grammar.js → generated parser) and highlight queries. |
vscode-bynk | The VS Code extension. |
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 bynkc # just the compiler's testscargo test -p bynkc 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/book/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.