2026-04-10 23:27:55 +02:00
---
layout: page
published: true
2026-04-11 00:18:36 +02:00
noToc: false
2026-04-10 23:27:55 +02:00
noComments: false
noDate: false
2026-06-14 22:16:13 +02:00
title: Contributing to Fun
2026-04-10 23:27:55 +02:00
subtitle: How to contribute, project structure, coding style, running tests, and PR guidelines.
description: How to contribute, project structure, coding style, running tests, and PR guidelines.
permalink: /documentation/contributing/
lang: en
tags:
2026-04-11 00:18:36 +02:00
- coding
- contribute
- contributing
- guidelines
- project
- running
- structure
- style
- tests
2026-04-10 23:27:55 +02:00
---
2026-02-18 17:39:10 +01:00
Thanks for your interest in contributing! This guide covers the basics to get you productive quickly.
## Getting started
2026-04-15 01:25:17 +02:00
- Clone the repo and build (see [../build/ ](../build/ )).
- Run tests locally (see [../testing/ ](../testing/ )).
- Explore examples (see [../examples/ ](../examples/ )).
2026-02-18 17:39:10 +01:00
## Project structure
2026-04-11 00:18:36 +02:00
- `src/` - C core, VM, and opcode implementations ([https://git.xw3.org/fun/fun/src/branch/main/src/ ](https://git.xw3.org/fun/fun/src/branch/main/src/ ){:class="git"}).
2026-02-18 18:11:21 +01:00
- `lib/` - Standard library written in Fun.
2026-04-11 00:18:36 +02:00
- `web/` - Website and documentation ([https://git.xw3.org/fun/fun/src/branch/main/web/ ](https://git.xw3.org/fun/fun/src/branch/main/web/ ){:class="git"}).
2026-02-18 18:11:21 +01:00
- `examples/` - Example programs and showcases.
- `spec/` - Language specification drafts.
2026-04-11 00:18:36 +02:00
- `cmake/` - CMake configuration and modules.
- `scripts/` - Utility scripts for development.
- `make` - Helper script for building (wraps CMake).
2026-02-18 17:39:10 +01:00
## Code style
- C: C99, two-space indent, no tabs. Keep functions short and focused.
- Fun: two-space indent, snake_case for functions, PascalCase for classes/constructors.
2026-04-15 01:25:17 +02:00
- Prefer clear names over abbreviations. See [../style-guide/ ](../style-guide/ ).
2026-02-18 17:39:10 +01:00
## Development workflow
1. Create a small, focused branch.
2026-04-15 01:25:17 +02:00
2. Add/adjust tests for behavior changes (see [../writing-tests ](../writing-tests/ )).
2026-02-18 17:39:10 +01:00
3. Update docs if user-visible behavior changes.
4. Submit a PR with a clear description and rationale.
## Commit/PR guidelines
- Keep commits atomic; include test updates with the change.
- Reference related issues.
- Include benchmarks only when meaningful and reproducible.
## Reporting bugs
Please include:
- Reproducer script (minimal), expected vs. actual behavior
- Build options and platform
- `fun --version` output
## Code of Conduct
2026-04-15 01:25:17 +02:00
Be respectful and inclusive. See [https://git.xw3.org/fun/fun/src/branch/main/CODE_OF_CONDUCT.md ](https://git.xw3.org/fun/fun/src/branch/main/CODE_OF_CONDUCT/ ){:class="git"} in the repository root.