Thank you for your interest in contributing to the Dim programming language!
- Python 3.6.8 or later
- Git
git clone https://github.com/Imposter-zx/Dim.git
cd Dim# Run all tests
python dim_tests.py
# Run tests by tag
python dim_tests.py --tag lexer
python dim_tests.py --tag parser
python dim_tests.py --tag typecheck
python dim_tests.py --tag mir
python dim_tests.py --tag borrow# Full pipeline build
python dim_cli.py build test.dim
# Individual stages
python dim_cli.py lex test.dim
python dim_cli.py parse test.dim
python dim_cli.py check test.dim
python dim_cli.py mir test.dim
python dim_cli.py borrow test.dimdim_token.py — Token and Span definitions
dim_lexer.py — Lexer (INDENT/DEDENT, keywords)
dim_parser.py — Recursive descent parser
dim_ast.py — AST node definitions
dim_types.py — Type system
dim_type_checker.py — Hindley-Milner type inference
dim_semantic.py — Semantic analysis
dim_mir.py — MIR (Mid-Level IR) structures
dim_mir_lowering.py — AST → MIR lowering
dim_mir_to_llvm.py — MIR → LLVM IR codegen
dim_borrow_checker.py — Ownership & borrow checking
dim_diagnostic.py — Error/warning system
dim_cli.py — CLI interface
dim_tests.py — Test suite
test.dim — Example source file
Tests are in dim_tests.py. Use the @test decorator:
@test("Description", "tag")
def test_name():
# Test code
passAvailable tags:
lexer- Lexer testsparser- Parser teststypecheck- Type checker testsmir- MIR lowering testsborrow- Borrow checker teststypes- Type system tests
- Use meaningful variable names
- Add docstrings for public functions
- Keep functions focused and small
- Use type hints where appropriate
- Lexer: Add tokens in
dim_token.py, implement indim_lexer.py - Parser: Add grammar rules in
dim_parser.py - AST: Define nodes in
dim_ast.py - Type Checker: Add rules in
dim_type_checker.py - MIR Lowering: Add lowering in
dim_mir_lowering.py - LLVM Codegen: Add codegen in
dim_mir_to_llvm.py - Tests: Add test cases in
dim_tests.py
- Use GitHub Issues
- Include minimal reproduction steps
- Attach relevant error output
- Specify Python version
- Use clear, descriptive commit messages
- Start with type:
feat:,fix:,docs:,test:,refactor:
- Fork the repository
- Create a feature branch
- Make changes with tests
- Ensure all tests pass
- Submit a pull request
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the work, not the person