Thank you for your interest in contributing to PyLua! This document provides guidelines and information for contributors to the PyLua v0.3 project.
PyLua v0.3 is a production-quality Python interpreter for Luau/Roblox. We follow CPython's design principles with a Lupa-inspired API.
Please read the internalDocs/ROADMAP.md to understand planned milestones and longer-term goals.
- Luau/Roblox Development Environment: Familiarity with Luau syntax and Roblox development
- Python Knowledge: Understanding of Python 3.12 syntax and semantics
- Git: Basic Git workflow knowledge
- Rokit: Tool manager for Roblox projects (for managing Jelly and other tools)
-
Fork and Clone
git clone https://github.com/your-username/PyLua.git cd PyLua -
Install Development Tools PyLua uses Jelly for project management and build scripts. Install it using Rokit:
# Install Rokit (if not already installed) # Follow instructions at: https://github.com/rojo-rbx/rokit # Install project tools (Jelly, Rojo, etc.) rokit install
Alternatively, you can install Jelly directly from its GitHub page.
-
Understand the Architecture
- Read internalDocs/README.md for documentation overview
- Review internalDocs/ROADMAP.md for upcoming work
- Study internalDocs/LANGUAGE_IMPLEMENTATION.md for technical background
-
Set Up Development Environment
- Install Roblox Studio or your preferred Luau development environment
- Configure your editor with Luau syntax highlighting
- Familiarize yourself with the test framework in
tests/
- Check existing issues first
- Use the bug report template
- Include minimal reproduction steps
- Specify which version/branch you're using
- Review the roadmap to ensure alignment with project goals
- Use the feature request template
- Consider Python 3.12 compliance requirements
- Discuss major features in issues before implementation
- Improve existing documentation
- Add code examples
- Fix typos and clarifications
- Update documentation when implementing features
- Follow the current development phase priorities
- Implement features according to the architecture plan
- Write comprehensive tests for new functionality
- Follow Python 3.12 compliance guidelines
-
Create an Issue (for non-trivial changes)
- Describe the problem or enhancement
- Discuss approach with maintainers
- Get feedback before starting work
-
Create a Feature Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-description -
Implement Your Changes
- Follow the coding standards (see below)
- Write tests for new functionality
- Update documentation as needed
-
Test Your Changes
PyLua uses Jelly for project management and build scripts. Available commands:
# Build the project jelly run build # Run tests jelly run test # Run development checks jelly run check
You can also run scripts directly using Jelly's configuration in
jelly.json. -
Submit a Pull Request
- Use the PR template
- Link to related issues
- Provide clear description of changes
- Include test results
- Follow Python semantics exactly where possible
- Reference CPython behavior for implementation details
- Use Python-like naming for opcodes and internal structures
- Implement proper operator precedence according to Python rules
- Handle edge cases as Python 3.12 would
-- Always include source location information
local function parseExpression(tokens: {Token}, pos: number): (Expr?, string?)
if not tokens[pos] then
return nil, string.format("Unexpected end of input at position %d", pos)
end
-- parsing logic with error context
local expr, err = parseSubexpression(tokens, pos)
if err then
return nil, string.format("Expression parsing failed at line %d: %s",
tokens[pos].line, err)
end
return expr, nil
end- Unit tests for all new functions and modules
- Integration tests for complex interactions
- Error case testing with proper error message validation
- Python compliance tests comparing with CPython behavior
Example test structure:
-- tests/unit/test_lexer.luau
local function testBasicTokenization()
local lexer = require('src.PyLua.lexer')
local tokens = lexer.tokenize("x = 42")
assert(#tokens == 3, "Expected 3 tokens")
assert(tokens[1].type == "NAME", "Expected NAME token")
assert(tokens[1].value == "x", "Expected 'x' value")
assert(tokens[2].type == "ASSIGN", "Expected ASSIGN token")
assert(tokens[3].type == "NUMBER", "Expected NUMBER token")
assert(tokens[3].value == 42, "Expected 42 value")
end- Self-review your code before submitting
- Test thoroughly including edge cases
- Update documentation for API changes
- Be responsive to review feedback
- Correctness: Does the code work as intended?
- Python Compliance: Does it match Python 3.12 behavior?
- Architecture Alignment: Does it fit the overall design?
- Test Coverage: Are there sufficient tests?
- Documentation: Is it properly documented?
- Performance: Is it reasonably efficient?
- Roadmap priorities for upcoming work
- Python 3.12 compliance and below
- Clean, maintainable code with proper separation of concerns
- Comprehensive testing for reliability
- Clear documentation for future contributors
- Don't copy from old implementation - it's fundamentally flawed
- Don't skip the architecture plan - follow the established phases
- Don't ignore Python semantics - maintain compliance
- Don't submit untested code - tests are mandatory
- Don't make breaking changes without discussion
phase-1-foundation- Core infrastructure workphase-2-parser- Parser implementationphase-3-objects- Object system developmentbug- Bug reports and fixesenhancement- New featuresdocumentation- Documentation improvementsgood-first-issue- Beginner-friendly taskshelp-wanted- Community assistance neededpython-compliance- Python behavior accuracy issues
- GitHub Issues for bug reports and feature requests
- GitHub Discussions for general questions and design discussions
- Pull Request comments for code-specific questions
- Review the documentation in
internalDocs/ - Check existing issues and discussions
- Ask specific, well-researched questions
- Provide context and examples when asking for help
Contributors will be recognized in:
- GitHub contributor list
- Release notes for significant contributions
- Project documentation for major features
Be respectful, constructive, and inclusive. We're building something great together!
- Be patient with new contributors
- Provide constructive feedback in reviews
- Ask questions when something is unclear
- Help others when you can
Thank you for contributing to PyLua! We look forward to your contributions and collaboration in building a great Python interpreter for Luau.