Getting Started with Morph Development
Prerequisites
| Tool | Minimum Version | Purpose |
|---|---|---|
| Windows | 10 / 11 | Primary CI and reference dev platform |
| MSYS2 + MinGW-w64 | Current | GCC, Ninja, LLVM, CMake (Windows) |
| LLVM | 15+ (typical via MSYS2) | Code generation backend |
| CMake | 3.20+ | Meta-build |
| Ninja | 1.11+ | Build executor |
| Python | 3.11+ | morphc driver (scripts/morphc_build) |
| Git | 2.30+ | Version control |
Install MSYS2 toolchain (Windows)
# In MSYS2 MINGW64 shell:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-ninja \
mingw-w64-x86_64-llvm mingw-w64-x86_64-libffi \
mingw-w64-x86_64-cmake
Clone and build (this repository)
Use morphc as the unified entry point — it auto-detects MSYS2/LLVM/Ninja and keeps workspace state under %LOCALAPPDATA%\Morph\workspaces\morph\ (see Playbook and scripts/README.md).
git clone https://github.com/jeandarcc/morph.git Neuron
cd Neuron
# Optional overrides (normally not needed):
# $env:MORPH_TOOLCHAIN_BIN = "C:\msys64\mingw64\bin"
morphc.bat build
# or: python -m scripts.morphc_build build
Full build + test suite:
morphc.bat build --test
Targeted tests:
morphc.bat test "flow"
morphc.bat test --list
Environment diagnosis:
morphc.bat doctor
Compiler artifacts land under %LOCALAPPDATA%\Morph\workspaces\morph\build-mingw\bin\ (e.g. morph.exe, morph_unit_tests.exe).
Do not use raw
cmake -S/-Bor ad-hoc Ninja for routine work. Legacyscripts\build.bat/build_tests.ps1exist for older automation butmorphcis the supported path.
VS Code
- Open the repo folder in VS Code.
- Install recommended extensions when prompted (
clangd,cmake-tools,editorconfig). - Use tasks if defined, or build from the terminal with
morphc.bat build. compile_commands.jsonis emitted under the workspace build directory forclangd.
Repository layout
src/ Compiler (lexer, parser, sema, NIR, MIR, codegen, CLI, LSP, vcon)
runtime/ Native runtime (platform, tensors, graphics, etc.)
include/ Public headers (morphc ABI)
tests/ C++ unit tests (single binary target)
morphs/ Morph packages (features, manifests, package-owned suites)
scripts/ morphc_build Python package + legacy scripts
config/ Branding, diagnostics, tooling config
extensions/ vscode-morph, intellij-morph
docs/ Guides, ADRs, Learn Morph, specs
benchmarks/ Performance assets
First change checklist
- Locate the relevant area in
src/ormorphs/(see architecture overview). - Implement the change; match existing style and tests.
- Add or update tests under
tests/and/ormorphs/*/tests/as appropriate. morphc.bat build(ormorphc.bat build --test).- Open a PR using
.github/PULL_REQUEST_TEMPLATE.md.