Installation
The Braid compiler (braidc) is built from source using CMake and Ninja. The build pipeline compiles the C lexer/parser and the C++ IR/codegen stages, producing a single CLI binary.
Prerequisites
- GCC 15+ — The C and C++ compiler used for both building braidc and compiling generated C code at runtime
- CMake 4.3+ — Build system generator
- Ninja — Fast build executor (optional but recommended)
- Git — For cloning the repository
Windows Setup (MSYS2)
On Windows, install MSYS2 and use the UCRT64 environment to get GCC 15+:
# Install MSYS2 from https://www.msys2.org
# Then in UCRT64 terminal:
pacman -S mingw-w64-ucrt-x86_64-gcc
pacman -S mingw-w64-ucrt-x86_64-cmake
pacman -S mingw-w64-ucrt-x86_64-ninja
pacman -S gitClone the Repository
git clone https://github.com/braid-group/braid-lang.git cd braid-langBuild braidc
The compiler lives under compiler/cpp/. Build it with CMake:
cd compiler/cpp
cmake -B build -G Ninja
cmake --build buildAfter a successful build, the braidc binary is at compiler/cpp/build/tools/braidc/braidc (or braidc.exe on Windows).
Add to PATH (Optional)
For convenience, add braidc to your PATH:
# PowerShell on Windows
$env:Path += ";C:\path\to\braid-lang\compiler\cpp\build\tools\braidc"
# Linux/Mac
export PATH=$PATH:/path/to/braid-lang/compiler/cpp/build/tools/braidcVerify Installation
Run the help command to verify braidc is working:
braidc --helpExpected output includes the pipeline commands (parse, ast, ir, mlir, llvm, ccodegen, build, run) and framework commands (frontend, junction).
Test with Hello World
Create a test file and run it:
echo 'fn main() { print("Hello, Braid!"); }' > hello.br
braidc run hello.brBuild Scripts (Alternative)
Pre-built shell scripts are also available in the repository root:
# Linux/Mac
./scripts/bootstrap_native.sh
./scripts/full_native_build.shThese scripts handle dependency checks and run the full CMake build pipeline automatically.
Troubleshooting
- CMake not found — Ensure CMake 4.3+ is installed and on your PATH
- GCC version too old — braidc requires GCC 15+ for C23 and C++23 features
- Missing Ninja — CMake will fall back to
makeif Ninja is unavailable; usecmake -B buildwithout-G Ninja - Windows build errors — Use MSYS2 UCRT64 environment. Native MSVC builds are not supported yet