Welcome contributors
Contributions to Walrus are welcome and encouraged! Whether you’re fixing bugs, adding features, improving documentation, or expanding the test suite, your help is appreciated.Areas of interest
There are many ways to contribute to Walrus:Standard library expansion
The standard library is still growing. Potential additions:- String utilities - Advanced string manipulation functions
- Collections - Set operations, advanced list/dict methods
- Networking - HTTP client, socket support
- JSON/serialization - Parse and generate JSON
- Regular expressions - Pattern matching support
- Time/date - DateTime handling and formatting
Performance optimizations
Help make Walrus faster:- Compiler optimizations - Constant folding, dead code elimination
- VM improvements - Faster bytecode dispatch, specialized opcodes
- JIT enhancements - Support more loop patterns, function inlining
- Memory efficiency - Reduce allocations, improve GC heuristics
Language features
New language capabilities:- Error handling - Exception system improvements
- Type annotations - Optional static typing
- Pattern matching - Match expressions
- Async/await - Asynchronous programming support
- Macros - Compile-time code generation
Documentation improvements
Better documentation helps everyone:- API documentation - Complete standard library docs
- Tutorials - Beginner-friendly guides
- Examples - Real-world use cases
- Reference - Comprehensive language specification
Testing and quality
Improve code quality:- Test coverage - Add tests for untested features
- Test framework - Automated test runner
- Benchmarks - Additional performance comparisons
- Fuzz testing - Find edge cases and crashes
Getting started
Check the issue tracker
Visit the GitHub issue tracker to find:
- Open bugs to fix
- Feature requests to implement
- Good first issues for newcomers
Development workflow
Making changes
- Write code - Implement your feature or fix
- Test locally - Verify your changes work correctly
- Add tests - Include tests for new functionality
- Update docs - Document new features or changes
- Run benchmarks - Check for performance regressions
Code style
Walrus follows standard Rust conventions:- Run
cargo fmtto format code - Run
cargo clippyto check for common issues - Follow Rust naming conventions
- Add comments for complex logic
Testing your changes
Benchmarking
If your changes affect performance:Submitting changes
Create a pull request
- Go to the Walrus repository
- Click “New Pull Request”
- Select your fork and branch
- Describe your changes clearly
- Reference any related issues
Pull request guidelines
Good pull requests
Focus on a single feature or fix
Include tests for new functionality
Update documentation as needed
Follow existing code style
Have clear commit messages
PR description template
Architecture overview
Understanding the codebase structure:Key modules
| Module | Purpose |
|---|---|
src/ast.rs | Abstract syntax tree definitions |
src/grammar.lalrpop | Parser grammar |
src/interpreter.rs | Tree-walking interpreter |
src/compiler.rs | Bytecode compiler |
src/vm.rs | Bytecode virtual machine |
src/gc.rs | Garbage collector |
src/heap.rs | Heap and memory management |
src/stdlib/ | Standard library modules |
src/lsp_support.rs | LSP semantic analysis |
src/bin/walrus-lsp.rs | Language server |
Execution flow
Interpreted mode:Common contribution patterns
Adding a built-in function
- Add the function to
src/interpreter.rsorsrc/vm.rs - Update builtin dispatch in the appropriate module
- Add hover docs to
src/bin/walrus-lsp.rs - Write tests in
tests/ - Document in README.md or docs
Adding a standard library module
- Create a new file in
src/stdlib/ - Implement module functions
- Register module in the import system
- Add examples and documentation
- Write comprehensive tests
Adding a language feature
- Update grammar in
src/grammar.lalrpop - Add AST nodes in
src/ast.rs - Implement in interpreter (
src/interpreter.rs) - Implement in compiler (
src/compiler.rs) - Implement in VM (
src/vm.rs) - Update LSP if needed (
src/lsp_support.rs) - Add tests and documentation
Community
Communication
- GitHub Issues - Bug reports and feature requests
- Pull Requests - Code contributions and reviews
- Discussions - Design discussions and questions
Code of conduct
- Be respectful and welcoming
- Provide constructive feedback
- Focus on what’s best for the project
- Help newcomers get started
License
Walrus is licensed under the MIT License. By contributing, you agree that your contributions will be licensed under the same license.Questions?
If you have questions about contributing:- Check existing issues and discussions
- Review this contributing guide
- Open a new issue with the “question” label
- Reach out to maintainers