Skip to content
Playground(another site)

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.

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 / projectWhat it is
bynk-syntax, bynk-check, bynk-emitThe compiler: lex → parse → resolve → check → emit.
bynkThe CLI (bynk), over bynk-driver’s command bodies.
bynk-fmtThe formatter, a leaf over bynk-syntax.
bynk-lspThe language server (bynk-lsp), built on tower-lsp.
tree-sitter-bynkThe grammar (grammar.js → generated parser) and highlight queries.

The workspace targets the Rust 2024 edition.

Terminal window
cargo build # build all workspace crates
cargo test # run the whole Rust test suite
cargo 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 tsc verification 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.

  • BYNK_BLESS=1 is 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 in design/decisions/. The remaining design/*.md notes 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.