Skip to content

Commit

Permalink
docs/stdlib: clarify 0.4 vs main branch
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <[email protected]>
  • Loading branch information
emidoots committed Sep 30, 2024
1 parent 371ac88 commit 4902c51
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions content/docs/stdlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,33 @@ The Mach standard library can be found at: [github.com/hexops/mach](https://gith

Thanks to Zig's lazy code evaluation and lazy dependency fetching, you really only pay for the parts you use.

## Getting started
## Choosing your Mach version

Add the Mach dependency to your `build.zig.zon` file:
### 0.4 branch (not actively developed, but more stable)

The 0.4 branch is what applications like [Pixi](https://github.com/foxnne/pixi) and games like `#lordofzero` (in the Discord) are using. It uses GLFW, WebGPU, and optionally the ECS. It is [no longer in development](https://discord.com/channels/996677443681267802/996688886216523907/1259736837648416829) however.

To use this version, add the Mach dependency to your `build.zig.zon` file:

<pre><code id="zig-fetch">zig fetch --save https://pkg.machengine.org/mach/$LATEST_COMMIT.tar.gz
</code></pre>
<script>
fetch('https://api.github.com/repos/hexops/mach/branches/0.4', {
method: 'GET',
headers: {'Accept': 'application/json'}},
)
.then(resp => resp.json())
.then(resp => {
let elem = document.querySelector('#zig-fetch');
elem.innerHTML = elem.innerHTML.replace('$LATEST_COMMIT', resp.commit.sha);
});
</script>

### main branch (actively developed, experimental/unstable)

This branch is where active development is happening, we are removing GLFW and WebGPU in favor of our own packages ([more details](https://discord.com/channels/996677443681267802/996688886216523907/1259736837648416829)) which means it is not stable - or may not even run - on some OS. At the time of writing Sep 30th, Windows is relatively stable, Linux might work under Wayland, and macOS is not expected to work currently.

To use this version, add the Mach dependency to your `build.zig.zon` file:

<pre><code id="zig-fetch">zig fetch --save https://pkg.machengine.org/mach/$LATEST_COMMIT.tar.gz
</code></pre>
Expand All @@ -31,6 +55,8 @@ fetch('https://api.github.com/repos/hexops/mach/branches/main', {
});
</script>

## Using the dependency

Then make it importable by your code in `build.zig`, e.g.:

```zig
Expand Down

0 comments on commit 4902c51

Please sign in to comment.