Contributor Guide
Getting Started
Section titled “Getting Started”- Fork and clone the repository:
git clone https://github.com/SailfinIO/sailfin.gitcd sailfin- Set up the development environment:
make compile # Build the compiler from seedmake test # Verify everything works- Create a feature branch:
git checkout -b feature/my-feature mainDevelopment Workflow
Section titled “Development Workflow”Making Changes
Section titled “Making Changes”- Edit compiler source in
compiler/src/*.sfn - Rebuild:
make compile - Run tests:
make test - Validate self-hosting:
make check
Adding a Language Feature
Section titled “Adding a Language Feature”- Update the parser (
compiler/src/parser.sfn) - Add AST nodes (
compiler/src/ast.sfn) - Update the emitter (
compiler/src/emit_native.sfn) - Extend LLVM lowering (
compiler/src/llvm/lowering/) - Add regression tests (
compiler/tests/) - Update the language spec (
site/src/content/docs/docs/reference/spec/NN-*.mdor.../reference/preview/*.md) anddocs/status.md
Self-Hosting Invariant
Section titled “Self-Hosting Invariant”The compiler must always compile itself. Before submitting:
make compile # Build from seedmake check # Validate seedcheck binarymake test # Full test suiteBranch Strategy
Section titled “Branch Strategy”main— Primary development branch; all feature work merges herebeta/rc— Short-lived branches cut frommainfor beta and release candidate cycles- Feature branches merge to
main
Principles
Section titled “Principles”- Fix the compiler, not the build script. Don’t add fixup passes — fix the root cause in
compiler/src/. - Reduce complexity. The fixup pass count should decrease over time.
- Build must be fast and deterministic. Under 5 minutes, zero retries.
Submitting Changes
Section titled “Submitting Changes”- Ensure
make checkandmake testpass - Open a PR against the
mainbranch - Include test coverage for new features or bug fixes
- Update documentation if the change affects language behavior
License
Section titled “License”Sailfin is licensed under the GNU General Public License v2. By submitting a contribution, you agree that your work will be distributed under the same license.
The runtime libraries include a Runtime Library Exception so that programs compiled by Sailfin are not subject to the GPL — users can license their own programs however they choose.