HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
hexops
mach
Zig2021–2025
hexops / mach

mach

zig game engine & graphics toolkit - mirror of https://code.hexops.com/hexops/mach

6Distinct people
10Mentions
0Explicit recommenders
4.9KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

zig game engine & graphics toolkit - mirror of https://code.hexops.com/hexops/mach

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:54:37 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year10 dated mentions

Observed mentions: 2021-09-08 19:56:40 UTC to 2025-11-11 00:13:28 UTC.

012342021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2025

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC312
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC404
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC101
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101

What Hacker News says

10 sources
Not much information here except to say it was moved into the Mach standard library [0] where apparently it doesn't even qualify for a separate README. Mach, apparently, is a game engine written in Zig. Looks interesting but given the lack of details on the repo [1] and site [2], and the fact that the main demo seems to be simply a spinning textured cube, I'd imagine it's very early days for this. [0] https://github.com/hexops/mach/tree/main/src/sysgpu [1] https://github.com/hexops/mach [2] https://machengine.org/
In Sysgpu – Experimental descendant of WebGPU written in Zig
We're working on a game engine in Zig[0] If you're looking for interesting Zig codebases to read, you might be interested in our low-level audio input/output library[1] or our module system[2] codebase - the latter includes an entity component system and uses Zig's comptime to a great degree to enable some interesting flexibility (dependency injection, global view of the world, etc.) while maintaining a great amount of type safety in an otherwise dynamic system. [0] https://machengine.org/ [1] https://github.com/hexops/mach/tree/main/src/sysaudio [2] https://github.com/hexops/mach/tree/main/src/module
In Leveraging Zig's Allocators
Zig fits pretty naturally here too. We've got ~19 WebGPU examples[1] which use Dawn natively (no browser support yet), and we build it using Zig's build system so it 'just works' out of the box with zero fuss as long as you grab a recent Zig version[2]. No messing with cmake/ninja/depot_tools/etc. WASM support in Zig, Rust, and C++ is also not equal. C++ prefers Emscripten which reimplements parts of popular libraries like SDL, for me personally that feels a bit weird as I don't want my compiler implementing my libraries / changing how they behave. Rust I believe generally avoids emscripten(?), but Zig for sure lets me target WASM natively and compile C/C++ code to it using the LLVM backend and soon the custom Zig compiler backend. [1] https://github.com/hexops/mach-examples [2] https://github.com/hexops/mach#supported-zig-version
In Learn WebGPU
This is very welcome and a long time coming! If you're eager to learn WebGPU, consider checking out Mach[0] which lets you develop with it natively using Zig today very easily. We aim to be a competitor-in-spirit to Unity/Unreal/Godot, but extremely modular. As part of that we have Mach core which just provides Window+Input+WebGPU and some ~19 standalone WebGPU examples[1]. Currently we only support native desktop platforms; but we're working towards browser support. WebGPU is very nice because it lets us target desktop+wasm+mobile for truly-cross-platform games & native applications. [0] https://github.com/hexops/mach [1] https://github.com/hexops/mach-examples/tree/main/core
In Chrome ships WebGPU
Very cool! I will definitely give this a try, I've been looking to build Go bindings to Mach[0] soon. It looks like this would make cross-compiling CGO easier (no target C toolchain needed?) Does this do anything to reduce the overhead of CGO calls / the stack size problem? IIRC the reason CGO overhead exists is at least partly because goroutines only have an ~8k stack to start with, and the C code doesn't know how to expand it-so CGO calls "must" first have the goroutine switched to an OS thread which has an ~8MB stack. One reason I think Go <-> Zig could be a fantastic pairing is that Zig plans to add a builtin which tells you the maximum stack size of a given function[1], so you could grow the goroutine stack to that size and then call Zig (or, since Zig an compile C code, you could also call C with a tiny shim to report the stack requ
Read the rest
ired?) and then eliminate the goroutine -> OS thread switching overhead. [0] https://github.com/hexops/mach [1] https://github.com/ziglang/zig/issues/157
In Purego – A library for calling C functions from Go without Cgo
In case you've ever wanted an opportunity to learn Zig and WebGPU, we have Zig bindings to Dawn (the Chrome implementation) with a fair amount of examples in Zig[0] - also working on getting WebAssembly support going right now. Can be a bit easier than trying it out in-browser (works on Linux, etc.) I'm shamelessly posting here because we're looking for folks[1] to contribute by porting more webgpu examples over to Zig :) Can be a fun way to get started with both, though. [0] https://machengine.org/gpu/ [1] https://github.com/hexops/mach/issues/230
In Get started with GPU Compute on the web
Hi Stephen, The initial example works for me. Truly impressive packaging you've achieved. I tried to build for musl, but it still links with glibc; is musl supported, or am I doing it wrong? motiejus ~/code/mach/gpu $ zig build -Dtarget=x86_64-linux-musl motiejus ~/code/mach/gpu $ ldd zig-out/bin/gpu-hello-triangle linux-vdso.so.1 (0x00007fff573a3000) libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f188c836000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f188c6f2000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f188c6d0000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f188c50b000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f188c505000) /lib64/ld-linux-x86-64.so.2 (0x00007f188c9a7000) libxcb.so.1 => /lib/x86_64-li
Read the rest
nux-gnu/libxcb.so.1 (0x00007f188c4da000) libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f188c4d3000) libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f188c2cd000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f188c2b6000) libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f188c2a9000) Also, I wasn't able to cross-compile to aarch64, because it does not seem to recognize `-Ddawn-from-source=true`, and I wasn't able to figure out where to put the `Options.from_source = true`: motiejus ~/code/mach/gpu $ zig build -Ddawn-from-source=true -Dtarget=aarch64-linux-musl error: gpu-dawn binaries for aarch64-linux.3.16...5.10.81-gnu.2.19 not available. error: -> open an issue: https://github.com/hexops/mach/issues error: -> build from source (takes 5-15 minutes): error: use -Ddawn-from-source=true or set `Options.from_source = true` error: the following build command failed with exit code 1: /home/motiejus/code/mach/gpu/zig-cache/o/a1cea9683aaa7b7e7a533b8f6e40e10f/build /home/motiejus/code/zig-linux-x86_64-0.10.0-dev.896+e620b692c/zig /home/motiejus/code/mach/gpu /home/motiejus/code/mach/gpu/zig-cache /home/motiejus/.cache/zig -Ddawn-from-source=true -Dtarget=aarch64-linux-musl motiejus ~/code/mach/gpu $
In Mach v0.1: Cross-platform Zig graphics
I totally 100% agree. "Getting started" with a C/C++ project is a huge pain and IMO where most people get stuck and give up on their weekend project. I'm working on a game engine in Zig[0], and I've been able to package up GLFW, write a build.zig file that `git clone`s all of the third-party system dependencies so that anyone can just: const glfw = @import("glfw/build.zig"); ... lib.addPackagePath("glfw", "glfw/src/main.zig"); glfw.link(b, lib, .{}); And have GLFW building (and cross-compiling!) for their project, without installing anything other than Zig and Git. No XCode. No `apt-get install ...`. Nothing. Just `zig` and `git` binaries. Zig is the C compiler and builds the GLFW source, and I have repositories with the required prebuilt system libs for cross compilation. [0] https://github.com/hexops/mach
In Maintain It with Zig

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.