Contributing
Typhon is open to contributions. The project is small enough that you can read the whole thing in a weekend; the scope is well-defined; the test suite is fast.
Before you start
- Check the roadmap. If your feature isn’t there, file an issue first to confirm it fits.
- Check the risks. Some additions are intentionally deferred.
- Read the design decisions. The constitution of the language.
Setting up
-
Fork and clone:
Terminal window git clone https://github.com/CodeHalwell/Typhon.gitcd Typhon -
Build:
Terminal window cd tyc && cargo build --release -
Run the tests:
Terminal window cargo test --workspace -
Verify the docs site builds (if you’re changing docs):
Terminal window cd ../docs-site && npm install && npm run build
Patch hygiene
- One concern per PR. Mixing a bug fix with a feature makes reviews painful.
- Add a test for every behaviour change. The test corpus is fast; there’s no reason not to.
- Run
cargo fmt --workspaceandcargo clippy --workspace --all-targets --all-features -- -D warningsbefore pushing. CI treats every warning as an error. - Run
cargo deny checkfor dependency audits. (Not always required for docs-only PRs.) - Know the nine CI jobs that run on every push to
main,dev/**, andclaude/**:test(cargo fmt --check→ clippy →cargo test --workspace),test-macos(the test suite on macOS),fmt-guard(no out-of-scopecargo fmtreformats),security(cargo-deny— advisories, licences, source/registry bans pertyc/deny.toml),perf-gate(scripts/perf-gate.sh— the fulltyc buildpipeline over a fixed corpus must not regress >20% pastperf-baseline.json),differential(the VM ↔ CPython differential gate over the wholeexamples/+stress/corpus; its baseline may only shrink),knob-matrix(the opt-in-knob codegen matrix),valid-corpus(tyc checkplus the VM ↔ CPython differential over thecorpus/valid/valid-programs corpus; its baseline may only shrink), andfmt-corpus(scripts/emitted-ast.py fmt-gate—tyc fmtover a de-formatted copy of the corpus must leave every unit’s emitted Python AST unchanged). A compiler change should keep all nine green; a docs-only change only exercisestest.
Where to make changes
| Change | Crate |
|---|---|
| Parse / lex | tyc-syntax (plus the vendored Ruff fork) |
| Scope / binding rules | tyc-resolve |
| Type system | tyc-types |
| Purity / async / comptime | tyc-analyse |
| Lowering | tyc-desugar |
| Python output | tyc-emit |
| Source maps | tyc-emit |
| Diagnostics | tyc-diagnostics (plus the emission site) |
| LSP | tyc-lsp |
| CLI | tyc/crates/tyc |
Adding a feature
The high-level pattern:
- Design. Open an issue. Get feedback. The design is what’s hard; the implementation usually follows.
- Tests first. Write a
.tyfile in the integration test corpus that exercises the feature. Watch the test fail. - Implement. Modify the relevant crate(s).
- Make the test pass.
- Document. Add or update pages under
docs-site/src/content/docs/.
Style
- Rust: standard
rustfmtstyle.cargo fmt --workspaceis the source of truth. - Comments: explain why, not what. The code already says what.
- Public APIs: doc-comment them.
PR description
- What changes and why.
- Which issue (if any) it closes.
- Migration notes if behaviour changes.
- Test plan: which tests cover the change.
Code of conduct
Be kind, be clear, be brief. We do not have a long CoC; common decency is the rule.
Where next
- Architecture — the codebase tour.
- Adding a Diagnostic — a worked example.
- Roadmap — what’s planned.