Contributing to Gat
We welcome contributions to the Gat compiler, standard library, documentation, and tooling!
1. Development Setup
Gat is self-hosting and requires no heavy build systems or external compilers:
- On Windows: Requires PowerShell.
- On Linux: Requires
bashand a working 64-bit kernel (or WSL2).
Clone the Repository
git clone https://github.com/DanielcoderX/gat.git
cd gat
2. Running Tests & Self-Hosting Verification
Before submitting changes, always run the full test and verification suite:
Windows
.\test.ps1
This runs:
- Stage 2 compiler compilation (
bin/gatc.exe -> bin/gatc-stage2.exe). - Stage 3 compiler compilation (
bin/gatc-stage2.exe -> bin/gatc-stage3.exe). - Bitwise identity check between Stage 2 and Stage 3 (
fc /b). - 23 feature and optimization test suites.
- 7 negative compiler diagnostics tests.
- Language Server (LSP) tests.
- Linux direct syscall suite via WSL (if installed).
Linux (WSL / Native)
# Run the Linux direct syscall suite
./bin/gatc examples/test_linux_suite.gat -o bin/test_linux_suite --target=linux
./bin/test_linux_suite
3. Coding Guidelines
- Self-Hosting Discipline: When editing compiler source files (
src/*.gat), ensure you only use language features currently supported by the baseline bootstrap compiler (bin/gatc.exe). - Deterministic Output: Compiler code generation must be deterministic; changes must not break the bitwise-identical stage comparison.
- Commit Convention: We follow Conventional Commits (e.g.
feat: ...,fix: ...,docs: ...,perf: ...,test: ...).