Getting Started using Mach

Install Zig version

Mach targets a specific recent Zig version, ensure you have it installed first: install Zig 2026.4.10-mach

Install Mach

Mach provides a CLI (and future graphical editor), build it from source:

git clone https://code.hexops.org/hexops/mach
cd mach/
zig build -Doptimize=ReleaseFast editor

Put the resulting zig-out/bin/mach executable onto your system PATH.

Create your project

In a directory of your choice, you can create a Mach project using:

mach init

This will create a basic “Hello, Mach!” example in your project directory which renders a triangle on screen.

Or, manually create the project yourself using 'zig init'

Without the Mach CLI, you can zig init a project, add the Mach dependency to build.zig.zon:

zig fetch --save https://pkg.hexops.org/pkg/hexops/mach/$LATEST_COMMIT.tar.gz

Then refer here for how a basic project looks.

Run the project

zig build run

Run tests

If you later decide to add any Zig test blocks to your src/App.zig, you can run them using zig build test.

Cross-compile

You can cross-compile this program to any major desktop OS using the following:

# Linux
zig build -Dtarget=x86_64-linux-gnu

# macOS (Apple Silicon)
zig build -Dtarget=aarch64-macos

# Windows
zig build -Dtarget=x86_64-windows-gnu

(the output will be in zig-out/bin/)

Continue learning

From here, you can explore more examples or read about the object systems which is the foundation of every Mach API.