Contributing to MOL¶
See the full CONTRIBUTING.md on GitHub.
Quick Setup¶
git clone https://github.com/crux-ecosystem/mol-lang.git
cd mol-lang
python -m venv .venv && source .venv/bin/activate
pip install -e .
python tests/test_mol.py # 147 tests should pass
Project Structure¶
MOL/
├── mol/ # Core language implementation
│ ├── grammar.lark # LALR grammar (Lark EBNF)
│ ├── parser.py # Parser + AST transformer
│ ├── ast_nodes.py # 28 AST node types
│ ├── interpreter.py # Tree-walking interpreter
│ ├── types.py # 8 domain types
│ ├── stdlib.py # 90+ built-in functions
│ ├── transpiler.py # Python & JS code generation
│ └── cli.py # CLI entry point
├── tests/
│ └── test_mol.py # 68 tests
├── examples/ # 8 example programs
├── tutorial/ # 6 tutorials
├── mol-vscode/ # VS Code extension
├── docs/ # MkDocs documentation
├── mkdocs.yml # Docs config
└── pyproject.toml # Package config
How to Add a New stdlib Function¶
- Add the Python function to
mol/stdlib.py - Register it in the
STDLIBdict at the bottom - Add a test in
tests/test_mol.py - Document it in
docs/reference/stdlib.md - Update the VS Code extension syntax:
mol-vscode/syntaxes/mol.tmLanguage.json - Run
python tests/test_mol.py— all tests must pass