Contributor Guide
Getting Started
- Fork and clone the repository:
git clone https://github.com/sailfin/sailfin.git
cd sailfin
- Set up the development environment:
make env # Create Conda environment
make compile # Build the compiler from seed
make test # Verify everything works
- Create a feature branch:
git checkout -b feature/my-feature alpha
Development Workflow
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
- 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
docs/spec.mdanddocs/status.md
Self-Hosting Invariant
The compiler must always compile itself. Before submitting:
make compile # Build from seed
make check # Validate seedcheck binary
make test # Full test suite
Branch Strategy
main— Stable releasesalpha— Prerelease builds (-alphasuffix)- Feature branches merge to
alpha
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
- Ensure
make checkandmake testpass - Open a PR against the
alphabranch - Include test coverage for new features or bug fixes
- Update documentation if the change affects language behavior