This substantially reduces consecutive build times when using mach/glfw. `system_sdk.getSdkPath` is frequently invoked as part of the build process, and previously it was doing some fairly involved work (ensuring the native SDK is at the right revision, needless `git fetch` in native SDKs to check for updates, etc.) We now do far less work in `getSdkPath`, and additionally cache the result in-memory. This improves build times substantially, but especially so with consecutive (non-cold-cache) build times: * For `mach/glfw`: ~2s before, ~160ms after * For `mach/gpu`: , ~16s before, ~3.6s after Signed-off-by: Stephen Gutekanst <stephen@hexops.com> |
||
|---|---|---|
| .github | ||
| dev | ||
| glfw | ||
| gpu | ||
| src | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmodules | ||
| build.zig | ||
| LICENSE | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
Mach engine

⚠️ Project status: in-development ⚠️
Under heavy development, not ready for use currently. Follow @machengine on Twitter for updates.
News
You can read about major Mach engine developments at devlog.hexops.com:
- Perfecting GLFW for Zig, and finding lurking undefined behavior that went unnoticed for 6+ years
- Mach engine: The future of graphics (with Zig)
Zero fuss installation & cross compilation
Mach is built from the ground up to support zero fuss installation & cross compilation, only zig and git are needed to build from any OS and produce binaries for every platform.
If you've ever worked with game engines in C, C++, Rust, Go, or any other language you've probably run into issues at one point getting the right system dependencies installed, whether it be library versions, compilers, system SDKs, X11/GLFW/SDL C dependencies, etc. With Mach, none of this is needed - it's all sorted out for you automagically.
Mach is able to do this thanks to Zig being a C/C++ compiler, Zig's linker zld supporting macOS cross compilation, and us doing the heavy lifting of packaging the required system SDK libraries and C sources for every dependency we need so our Zig build scripts can simply git clone them for you as needed for the target OS you're building for, completely automagically.
Supported platforms
Mach is still incredibly early stages, so far we have support for building from the following OS to the following targets:
| Building for | From macOS x86_64 | From macOS M1/aarch64 | From Linux x86_64 | From Windows x86_64 |
|---|---|---|---|---|
| macOS x86_64 | ✅ | ✅ | ✅ | ✅ |
| macOS M1/aarch64 | ✅ | ✅ | ✅ | ✅ |
| Linux x86_64 | ✅ | ✅ | ✅ | ✅ |
| Windows x86_64 | ✅ | ✅ | ✅ | ✅ |
| iOS | 🏃 | 🏃 | 🏃 | 🏃 |
| Android | 🏃 | 🏃 | 🏃 | 🏃 |
- ✅ Tested and verified via CI.
- ✔️ Should work, not tested via CI yet.
- 🏃 Planned or in progress.
- ⚠️ Implemented, but has known issues (e.g. bugs in Zig.)
Libraries for all
Whether you're interested in using all of Mach, or just some parts of it, you get to choose. Our libraries all aim to have the same zero-fuss installation, cross compilation, and platform support:
- mach-glfw: Ziggified GLFW bindings with 100% API coverage
About sub-repositories
In this repository, we maintain Mach as a monorepo. We pull in all commits from our library sub-repositories listed above using git subtree:
git subtree pull --prefix glfw https://github.com/hexops/mach-glfw main
This pulls in all commits from our sub-repositories, and effectively leads to a full history of all Mach development across all core repositories.
Pull requests can be made to any repository (we synchronize both ways via git subtree pull and git subtree push.)
There are only two requirements:
- Pull requests in sub-repositories must have a commit message prefix, e.g.
glfw: <commit message>to keep our monorepo history nicer - we generally squash merge pull requests so this is not an issue. - Pull requests to this repository may not change multiple sub-repositories in the same commit (e.g. a commit to
glfw/should not also include changes towebgpu/, to avoid confusion.)
Sponsors
If you like Mach engine, or my other work, you may sponsor me on GitHub. This will make my day, it's a huge vote of confidence and I really appreciate your support!
Silver sponsors

Bronze sponsors










