Skip to content

Contributing

Contributions to lash are welcome. This page covers the repository layout, build process, and conventions you need to follow.

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)
Terminal window
# Build
dub build
# Run tests
dub test

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.

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, or common.
  • All structs, classes, and interfaces must have /// doc comments.

Lash has extensive test coverage:

CategoryCount
Unit tests~1600
Integration test files11
.lash script tests59
Blackbox tests (Python)13

Run the full suite with:

Terminal window
dub test

Blackbox tests live under tests/ and require Python 3.

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.

  1. Fork the repository on GitLab.
  2. Create a feature branch from main.
  3. Make your changes following the code constraints above.
  4. Run dub test and ensure all tests pass.
  5. Submit a merge request against main.