Skip to content

Contributing

Thank you for considering a contribution. This page is the short version of what you need to know; the repository’s own docs hold the detail.

The two compilers

The compiler is written in Fid (compiler/*.fd, 72 modules, about 210K lines). The earlier compiler in Rust (src/*.rs) is frozen: it runs the test suite and builds stage 1 of the bootstrap, and gets no new features. It checks less than fid, and the language is what fid accepts: see the language reference.

You want to…Use
Write Fid programs, add tests, add stdlib modulesthe self-hosted compiler (release/fid.exe)
Build tools (ark, scribe, veil)cargo build --release
Change the language or compiler internalscompiler/*.fd only

Setting up

git clone https://github.com/pledgeandgrow/fid
cd fid
cargo build --release          # builds fidesc, ark, scribe, veil
./target/release/fidesc test --compiler fid   # every test program on all backends, compiled by fid

./verify.sh runs the build and the tests and diffs the results against the checked-in baseline, so you can see exactly which tests a change affects. Run it before you start and after every change.

Good first contributions

  • A test program. Add tests/bootstrap/test_<feature>.fd, run ./verify.sh --save to update the baseline. Every test runs on the interpreter, the C backend, and the native emitter. A program the compiler must reject is named test_<feature>_fail.fd and starts with a // expect-error: line.
  • A standard library module or function. stdlib/*.fd is plain Fid; mistakes surface as test failures, not silent miscompiles. Add a /// doc comment and scribe documents it.
  • Docs and error messages. Every docs page on this site has a “Report an issue” link at the bottom.
  • A bug report with a minimal reproducer. Often more valuable than a patch.

Compiler changes

Some files can break every program silently when edited: the register allocator, the peephole optimiser, the object-file emitters, and the code generators. The repository’s AGENTS.md lists them with the risk level of each. For those:

  1. Run ./verify.sh first to confirm a clean baseline.
  2. Make the smallest possible change: one change, one commit, one verification run.
  3. If a test regresses, find the stage responsible with dump-ir, dump-pir and codegen --peephole.
  4. Every bug you fix gets a regression test in the same change.

Never rewrite history, force-push, or discard someone else’s uncommitted work in a shared checkout; the repository guide is explicit about this.

Pull requests

  • One topic per PR, with the test that proves it.
  • Say which backends you ran. “Interpreter only” is a fine answer; it tells the reviewer what to check.
  • Keep the docs truthful: if a change moves a feature from partial to working (or the reverse), update docs/reference/features.md in the same PR. Feature Status on this site mirrors that file.

The website

This site lives in its own repository and is a static Astro build. npm run dev starts it, npm run check lints and type-checks, npm run build must pass before a PR is merged. Docs pages are Markdown under src/pages/docs/ and are registered in src/data/docsNav.ts.

Conduct and licensing

All spaces run under the Code of Conduct. By contributing you agree that your contribution is licensed under the project’s licence as published in the repository.