Install
Install the latest mach release with a single command, grab a precompiled binary, or build the self-hosted compiler from source. There are no external toolchain dependencies to install first.
Quick install
The one-line installer fetches the latest release for your platform.
On Unix and macOS:
curl -fsSL https://machlang.org/install.sh | sh
On Windows (PowerShell):
irm https://machlang.org/install.ps1 | iex
The docs read like a pamphlet, not a bible, and assume you know basic programming concepts from other languages. Skim the language reference alongside this guide as you go.
What the installer does
Each script verifies the download against the release SHA256SUMS before extracting it, and a mismatch or a missing entry installs nothing. It then drops the mach binary into a per-user location. At a terminal it asks for the install directory, offering the default below. MACH_INSTALL_DIR skips the prompt with a directory of your own, and MACH_VERSION pins a release (for example 6.8.0) instead of the latest.
| Platform | Install location |
|---|---|
| Unix / macOS | ~/.local/bin |
| Windows | %LOCALAPPDATA%\mach\bin |
Precompiled binaries
Precompiled binaries for each release are available directly on the releases page. Download the archive for your target and place the mach binary on your PATH if you prefer not to use the installer.
Build from source
Mach builds itself, so compiling from source needs an existing mach installation. Install a release first, then clone, pull dependencies, and build.
git clone https://github.com/briar-systems/mach
cd mach
mach dep pull .
mach build .
The compiler is written to out/<target>/<profile>/bin/mach, for example out/linux-x86_64/debug/bin/mach. mach build never fetches, so mach dep pull . comes first.
Because mach is self-hosted, there is no bootstrap path without a working mach binary. Use the quick installer or a precompiled binary to get the first compiler, then build from source.
See also
- Hello world - write, build, and run your first program
- Project layout - scaffold a project with
mach init - CLI - the
machcommand-line reference - Dependencies - what
mach dep pullvendors