Contributing
Contributions to lash are welcome. This page covers the repository layout, build process, and conventions you need to follow.
Repository
Section titled “Repository”- URL: https://gitlab.com/szabobogdan3/lash
- License: MIT
Build Requirements
Section titled “Build Requirements”Lash is written in DLang. You need one of the following compilers plus the
dub package manager:
- LDC2 (recommended for release builds)
- DMD (faster compilation during development)
# Builddub build
# Run testsdub testArchitecture
Section titled “Architecture”Lash uses a five-layer architecture with strict downward-only dependencies:
runtime/ -> (nothing, only std library)lang/ -> runtime/protocol/ -> runtime/backend/ -> lang/, protocol/, runtime/frontend/ -> protocol/, runtime/ (never imports backend/)plugins/ -> backend/plugin/base/, protocol/, runtime/- runtime/ — pure types (
LashValue,Scope,LashError), OS abstractions. - lang/ — lexer, parser, evaluator, expansion, optimizer (turbo analysis/fusion/operations/heap).
- protocol/ — wire format (codec, encoders, decoders), transport, IPC.
- backend/ — execution (pipeline, redirects, streaming, PTY, turbo), daemon, session, config, hooks, plugins, script.
- frontend/ — terminal input, raw mode, key reader, completion, history, rendering, connection.
Code Constraints
Section titled “Code Constraints”These constraints are enforced across the entire codebase:
- No file may exceed 500 lines.
- Each file contains one struct/class or a cohesive group of free functions.
- No files named
utils,helpers, orcommon. - All structs, classes, and interfaces must have
///doc comments.
Test Suite
Section titled “Test Suite”Lash has extensive test coverage:
| Category | Count |
|---|---|
| Unit tests | ~1600 |
| Integration test files | 11 |
.lash script tests | 59 |
| Blackbox tests (Python) | 13 |
Run the full suite with:
dub testBlackbox tests live under tests/ and require Python 3.
Adding a New Method
Section titled “Adding a New Method”The evaluator method system has its own guide. See
source/lash/lang/evaluator/methods/ADDING_METHODS.md for step-by-step
instructions on registering a new built-in method, writing its implementation,
and adding tests.
Workflow
Section titled “Workflow”- Fork the repository on GitLab.
- Create a feature branch from
main. - Make your changes following the code constraints above.
- Run
dub testand ensure all tests pass. - Submit a merge request against
main.