Thank you for your interest in contributing to Melbi! This document outlines well-defined, reasonably independent sub-projects that are suitable for external contributors.
- Read the development guide: See
CLAUDE.mdfor building, testing, and development workflow - Understand TDD approach: We follow strict Test-Driven Development - write tests first, then implement
- Check existing issues: Look for issues tagged
good-first-issueorhelp-wanted - Ask questions: Open a discussion or issue if anything is unclear
We've organized contribution opportunities by difficulty level. Each project includes estimated time, required skills, and specific files to modify.
Perfect for first-time contributors or getting familiar with the codebase.
Description: Implement Map Display is complete. Symbol type doesn't have a runtime representation yet (no symbol literals exist), so Symbol Display is N/A.Display trait for Map and Symbol types, which currently show placeholder addresses.
Why contribute this:
- Quick win with immediate visible impact
- Clear specification (follow the Function Display implementation we just completed)
- Improves debugging and error messages
- Good introduction to Melbi's value system
Skills Required:
- Basic Rust (traits, pattern matching)
- Understanding of Display vs Debug traits
Files to Modify:
core/src/values/dynamic.rs(lines 72-77 for Map, lines 94-98 for Symbol)core/src/values/display_test.rs(add tests similar to function Display tests)
Success Criteria:
- Map displays as
<Map @ 0x...: {key_type => value_type}> - Symbol displays with meaningful information
- All tests pass
- Both Display and Debug implementations
Estimated Time: 2-4 hours
Description: Many evaluator errors have Evaluator errors now include proper source spans.span: None. Add proper source location tracking for better error messages.
Why contribute this:
- Significantly improves developer experience
- Well-defined task (grep for
span: None) - Learn Melbi's error handling architecture
- Non-breaking change
Skills Required:
- Basic Rust
- Understanding of source spans
- Reading error flow through call stacks
Files to Modify:
core/src/evaluator/eval.rs(lines 359, 369, and others withspan: None)core/src/evaluator/error.rs(ensure span is propagated)- Add tests verifying error spans are correct
Success Criteria:
- All evaluator errors include source spans where available
- Error messages point to exact location in source
- Tests verify span accuracy
Estimated Time: 4-6 hours
Description: Add proper CLI modes: melbi eval, melbi check, melbi fmt, melbi run <file>.
Why contribute this:
- User-facing improvement with immediate value
- Self-contained (CLI is separate package)
- Existing REPL code provides examples
- Clear requirements from MVP roadmap
Skills Required:
- Rust basics
- clap library (already used in the project)
- File I/O
Files to Modify:
cli/src/main.rs(currently 215 lines - needs expansion)- Add integration tests in
cli/tests/
Required Subcommands:
melbi eval "1 + 2"- evaluate expression and print resultmelbi check script.melbi- type-check file without runningmelbi fmt script.melbi- format file (or--checkfor CI)melbi run script.melbi- evaluate file and print result- Keep existing REPL as default with no args
Success Criteria:
- All four subcommands work correctly
- Help text is clear and complete
- Error handling is user-friendly
- Integration tests cover each mode
Estimated Time: 6-10 hours
Description: Expand benchmarks beyond arithmetic chains to test arrays, records, where bindings, pattern matching.
Why contribute this:
- Helps identify performance bottlenecks
- Low risk (doesn't change functionality)
- Good introduction to Criterion.rs
- Learn Melbi's evaluation system
Skills Required:
- Rust basics
- Criterion.rs (examples already exist in the codebase)
- Understanding of Melbi syntax
Files to Modify:
core/benches/evaluator.rs- Potentially add new benchmark files for specific features
Suggested Benchmarks:
- Array operations (creation, indexing, iteration)
- Record operations (creation, field access)
- Where bindings (simple vs nested)
- Pattern matching (when available)
- String operations
- Complex nested expressions
Success Criteria:
- At least 5 new meaningful benchmark scenarios
- Benchmarks run successfully with
cargo bench - Results are reproducible
Estimated Time: 4-8 hours
Substantial features requiring deeper understanding of Melbi's architecture.
Description: Add All comparison operators have been implemented.==, !=, <, >, <=, >= operators to parser, analyzer, and evaluator.
Why contribute this:
- Essential for MVP - marked as critical in roadmap
- Touches all three major systems (great learning opportunity)
- Clear specification from existing arithmetic operators
- High impact - enables actually useful programs
Skills Required:
- Rust (intermediate level)
- PEST parser grammar
- Type system basics
- Pattern matching
Files to Modify:
-
Parser (
core/src/parser/expression.pest):- Add comparison operator grammar rules
- Define precedence (lower than arithmetic, higher than logical)
-
Parser (
core/src/parser/parser.rs):- Add operator precedence handling
- Add to Pratt parser
-
Analyzer (
core/src/analyzer/analyzer.rs):- Add type checking for comparison operators
- All comparisons return
Bool - Handle type compatibility (can't compare incompatible types)
-
Evaluator (
core/src/evaluator/eval.rs):- Implement evaluation for each operator
- Handle different value types (Int, Float, String, Bool)
-
Tests (
core/tests/andcore/src/evaluator/eval_test.rs):- Comprehensive test coverage for all operators and types
Implementation Notes:
- Look at existing arithmetic operators (
+,-,*,/) as templates - Equality (
==,!=) works on all types - Ordering (
<,>,<=,>=) works on Int, Float, String (lexicographic) - Consider: should
3.0 == 3be true? (type coercion?) - All comparison operators return
Bool
Success Criteria:
- All six operators parse correctly
- Type checking rejects invalid comparisons
- Evaluation produces correct results
- Comprehensive test coverage
- Formatter handles comparison operators
Estimated Time: 12-20 hours
Description: Analyzer is complete for Maps, but evaluator needs implementation. Maps are now fully implemented in the evaluator.
Why contribute this:
- Clear scope (evaluator only - analyzer done)
- High user value (key-value data structures)
- TODOs in code mark exact locations
- Analyzer provides complete specification
Skills Required:
- Rust (intermediate level)
- HashMap understanding
- Value hashing implementation
- Arena allocation patterns
Files to Modify:
core/src/evaluator/eval.rs- Implement map creation and accesscore/src/values/dynamic.rs- Implement Hash for Value, improve Displaycore/src/values/map.rs(may need to create) - Map data structure- Add comprehensive tests
Implementation Notes:
- Values need Hash trait implementation for use as map keys
- Consider HashMap vs BTreeMap (determinism for testing)
- Arena allocation for map storage
- Map operations: creation
{k1: v1, k2: v2}, accessmap[key] - Need to handle: duplicate keys, missing keys, type checking
Dependencies:
- Display implementation for Map (Project #1) helps with debugging
Success Criteria:
- Map creation works correctly
- Map access returns correct values
- Missing keys handled appropriately
- All tests pass
- Display shows map contents usefully
Estimated Time: 15-25 hours
Description: Implement core LSP features: diagnostics (errors/warnings), go-to-definition, hover information. Diagnostics are complete. Go-to-definition and hover may need additional work.
Why contribute this:
- Major improvement to developer experience
- Self-contained (LSP package separate from core)
- Structure already exists (764 lines)
- Good for learning LSP protocol
Skills Required:
- Rust (intermediate level)
- tower-lsp library
- LSP protocol understanding
- Parser/analyzer integration
Files to Modify:
lsp/src/document.rs(TODOs on lines 140, 268, 413, 426)lsp/src/main.rs- Handler implementationslsp/tests/- Integration tests
Features to Implement:
-
Diagnostics β DONE:
- Parse errors with proper ranges
- Type errors with proper ranges
- Warnings for unused variables
-
Go to Definition (may need work):
- Jump to variable bindings
- Jump to function definitions
- Handle where bindings
-
Hover Information (may need work):
- Show inferred types
- Show function signatures
- Show documentation (when available)
-
Formatting (already exists):
- Verify integration works correctly
Success Criteria:
- VS Code extension shows errors/warnings
- Go-to-definition works for variables and functions
- Hover shows type information
- All LSP tests pass
Estimated Time: 20-30 hours
Description: Add proptest or quickcheck-based tests for finding edge cases and ensuring correctness properties.
Why contribute this:
- Significantly improves code quality
- Self-contained (new test files)
- Good learning opportunity for property-based testing
- Complements existing unit tests
Skills Required:
- Rust (intermediate level)
- proptest or quickcheck library
- Understanding of property-based testing concepts
- Melbi language semantics
Files to Create:
core/tests/property_tests.rs(or multiple files by category)- Integration with existing test infrastructure
Example Properties to Test:
-
Parser Properties:
- Parsing is deterministic
- Format preserves semantics:
parse(format(parse(x))) β parse(x) - Invalid syntax always produces parse error
-
Type Checker Properties:
- Type checking is deterministic
- Well-typed programs don't produce type errors
- Type inference is consistent
-
Evaluator Properties:
- Evaluation produces values matching their types
- Arithmetic properties: commutativity, associativity
- Array operations preserve length correctly
-
Formatter Properties:
- Idempotency:
format(format(x)) == format(x) - Parsing succeeds:
parse(format(x))succeeds ifparse(x)succeeds - Semantics preserved:
eval(format(x)) == eval(x)
- Idempotency:
Success Criteria:
- At least 20 meaningful properties tested
- Tests find edge cases (document any bugs found!)
- Integration with
cargo test - CI runs property tests
Estimated Time: 20-30 hours
Complex projects requiring deep understanding of compiler/interpreter architecture.
Description: Implement compile-time evaluation of constant expressions on the typed AST.
Why contribute this:
- Competitive advantage - CEL doesn't do this
- Clear performance win (eliminate runtime computation)
- Well-defined optimization pass
- Independent of other features
Skills Required:
- Rust (advanced level)
- Compiler optimization techniques
- AST traversal and transformation
- Deep understanding of Melbi's type system
- Arena allocation patterns
Files to Create/Modify:
core/src/optimizer/(new module)core/src/optimizer/constant_folding.rs(main implementation)core/src/analyzer/typed_expr.rs(may need modifications)- Integration with compilation pipeline
- Comprehensive tests and benchmarks
Implementation Approach:
-
Operate on TypedExpr (after type checking):
- Input: Typed AST from analyzer
- Output: Optimized AST with constants folded
- Preserve all type information and spans
-
Fold Constant Expressions:
- Arithmetic:
2 + 3β5 - Boolean:
true and falseβfalse - String:
"hello" + " world"β"hello world" - Conditionals:
if true then a else bβa - Array/Record creation with constant elements
- Arithmetic:
-
Preserve Semantics:
- Don't fold expressions with side effects (if any)
- Don't fold expressions that might error at runtime
- Maintain span information for debugging
-
Optimization Opportunities:
- Dead code elimination (unreachable branches)
- Constant propagation through where bindings
- Pre-compute array lengths, record field types
Success Criteria:
- Constant expressions are evaluated at compile time
- Semantics are preserved (same results as runtime eval)
- Spans preserved for error reporting
- Benchmarks show performance improvement
- All tests pass
Estimated Time: 30-50 hours
Description: Design and implement the three-tier public API: unsafe (C FFI), dynamic (heap-allocated), and static (zero-cost). Public API has been implemented.
Why contribute this:
- Critical for MVP - enables all real-world Rust usage
- Well-documented (50+ page design doc exists)
- Comprehensive learning opportunity
- High impact on user experience
Skills Required:
- Rust (expert level)
- API design expertise
- Lifetime and ownership mastery
- Generic programming and trait design
- FFI and C interop knowledge
- Performance optimization
Components to Implement:
-
Engine and Compilation API β :
Engine- compilation contextScript- compiled program- Error handling with proper spans
-
Environment Builder β :
- FFI function registration
- Global variable injection
- Type-safe wrappers
-
Value Construction/Extraction β :
- Dynamic API: heap-allocated, safe, ergonomic
- Static API: zero-cost, compile-time checking
- Conversion between Rust and Melbi types
-
Unsafe/C FFI Layer β :
- Raw pointers and manual memory management
- C-compatible function signatures
- Header generation
-
Error Handling β :
- Rich error types with context
- Result types for Rust API
- Error codes for C API
Files to Create:
core/src/api/(new module structure)core/src/api/engine.rscore/src/api/environment.rscore/src/api/value.rscore/src/api/ffi.rs- Comprehensive examples in
examples/ - Integration tests
Reference:
- Design doc:
docs/public-api-design.md(assumed to exist) - Study existing embedded scripting languages (Lua, Rhai, etc.)
Success Criteria:
- Clean, ergonomic Rust API
- Zero-cost static API where possible
- Complete C FFI with header generation
- Comprehensive examples and documentation
- All tests pass
- Benchmarks show performance
Estimated Time: 80-120 hours (2-3 months part-time)
Description: Implement optional formal verification using CBMC for safety-critical applications.
Why contribute this:
- Unique differentiator for Melbi in the embedded scripting space
- Comprehensive design doc exists (50+ pages)
- Interesting research opportunity
- High value for specific domains (automotive, aerospace, finance)
- Can be contributor-led exploration
Skills Required:
- Rust (advanced level)
- Formal methods understanding
- CBMC knowledge and experience
- Compiler/translator design
- C code generation
- SMT solvers and verification concepts
Phases:
Phase 1: Foundation (30-40 hours)
- Directive parsing (
#[verify],#[requires], etc.) - API design for verification annotations
- Integration with parser
Phase 2: Basic CBMC Integration (40-60 hours)
- Melbi β C translator for simple expressions
- CBMC invocation and result parsing
- CI/CD integration
Phase 3: Advanced Features (40-60 hours)
- Recursion and loops
- Arrays and complex data structures
- Property checking (assertions, invariants)
Phase 4: Production Hardening (30-40 hours)
- Performance optimization
- Error handling and diagnostics
- Documentation and examples
Files to Create:
melbi-verify/(new package)melbi-verify/src/translator.rs- Melbi to C translationmelbi-verify/src/cbmc.rs- CBMC integrationmelbi-verify/src/properties.rs- Property specification- Examples in
examples/verification/
Reference:
- Design doc:
docs/formal-verification-plan.md(assumed to exist) - CBMC documentation
- Study other verified languages
Success Criteria:
- Can verify simple Melbi programs with CBMC
- Properties can be specified and checked
- CI integration demonstrates usage
- Documentation with examples
- Known limitations clearly documented
Estimated Time: 150-250 hours (6-9 months part-time)
Note: This is a long-term project suitable for academic research, thesis work, or sustained open-source contribution.
Description: Write comprehensive user-facing documentation: getting started guide, language tutorial, and cookbook with practical examples.
Why contribute this:
- Critical for adoption and user onboarding
- No code changes required (lower risk)
- Great for technical writers and educators
- Helps identify UX issues in the language
Skills Required:
- Technical writing
- Understanding of Melbi syntax and semantics
- Example creation and testing
- Documentation tools (mdbook, rustdoc, etc.)
Deliverables:
-
Getting Started Guide:
- Installation instructions
- First Melbi program
- Basic syntax overview
- REPL usage
-
Language Tutorial:
- Types and literals
- Operators and expressions
- Where bindings
- Arrays and records
- Pattern matching
- Functions and lambdas
- Error handling
-
Language Reference:
- Complete syntax specification
- Type system rules
- Standard library (when available)
- Error messages explained
-
Cookbook:
- Common patterns and idioms
- Data validation examples
- Configuration processing
- Integration with Rust
- Performance tips
-
Integration Examples:
- Embedding in Rust applications
- FFI function registration
- Error handling patterns
- Testing embedded scripts
Files to Create:
docs/book/(mdbook structure)examples/(runnable examples)- Update
README.mdwith links
Success Criteria:
- Complete coverage of language features
- All examples tested and working
- Clear, beginner-friendly writing
- Good search and navigation
- Published to GitHub Pages
Estimated Time: 40-60 hours
- Pick a project matching your skill level and interests
- Check if anyone else is working on it (open issues/PRs)
- If unsure, open an issue to discuss before starting
# Clone the repository
git clone https://github.com/yourusername/melbi.git
cd melbi
# Build and test
cargo build
cargo test
# See CLAUDE.md for detailed development workflowMelbi follows strict TDD practices:
- Write tests first: Add failing tests that specify the desired behavior
- Verify tests fail: Run tests and confirm they fail for the right reason
- Implement feature: Write minimal code to make tests pass
- Verify tests pass: Run tests and confirm they pass
- Refactor: Improve code while keeping tests green
See CLAUDE.md for detailed testing guidelines.
git checkout -b feature/your-feature-name- Follow existing code style and patterns
- Add comprehensive tests
- Update documentation as needed
- Run tests frequently:
cargo test - Use efficient test output:
cargo test 2>&1 | grep "test result:"
- Push your branch to GitHub
- Create a Pull Request with:
- Clear description of what you changed
- Why the change is needed
- How you tested it
- Link to any related issues
- Be responsive to review feedback
- Questions: Open a GitHub Discussion or Issue
- Bugs: Report via GitHub Issues
- Design discussions: Open a GitHub Discussion
- Documentation: Check
CLAUDE.mdanddocs/directory
- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help others learn and grow
- Maintainers will review your PR
- May request changes or ask questions
- Once approved, PR will be merged
- Your contribution will be credited
All contributors are recognized in:
- Git commit history
- Release notes
- Contributors list (when established)
If you have questions about any of these projects or want to propose a new contribution, please:
- Check existing documentation (
CLAUDE.md,docs/) - Search existing issues and discussions
- Open a new issue or discussion
Thank you for contributing to Melbi! π