mach
zig


mach | zig | |
---|---|---|
38 | 863 | |
3,707 | 37,281 | |
6.6% | 4.5% | |
9.7 | 10.0 | |
10 days ago | 6 days ago | |
Zig | Zig | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
mach
-
Show HN: Lyceum – An MMO game built with Zig and Erlang
Did you happen to tinker with https://machengine.org/ it's a Zig game engine & graphics toolkit?
-
Leveraging Zig's Allocators
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
-
Zig Software Foundation 2024 Financial Report and Fundraiser
Myself and many others are betting on Zig in major ways, I truly think it has a bright future ahead.
In spare time, myself and a few others are working on a game engine in Zig[0], and the Zig core team has been very receptive to addressing issues our project faces and supporting us.
Others are working on pixel art editors[1], open source 2D RPG games[2], there's a group of independent folks working on a 3D massive immersive sim game[3], a group working on making Zig an amazing language for micro-controllers[4], etc.
Please consider donating $5-10 a month to the ZSF! They are a great group of people, and it has so many knock-on effects for others in the FOSS community. :)
[0] https://machengine.org/
[1] https://github.com/foxnne/pixi
[2] https://github.com/foxnne/aftersun
[3] https://github.com/Srekel/tides-of-revival
[4] https://github.com/ZigEmbeddedGroup
-
DevDocs
I don't know if there's anything better than a zip. For our website[0] which includes a bunch of docs for our game engine, Zig packages, etc. we just offer a link "offline version of this site" in the footer which is an ~80MB zip file.
I think the challenge with zip files is.. do you want all the images? do you want all versions of the docs, or just a specific version of the docs? It's hard to tailor the zip to the user's desire. But zip still seems to be the best.
[0] https://machengine.org/
- Not only Unity...
- Mach - Zig game engine & graphics toolkit
- New Béziers from Math
-
0.11.0 Release Notes
A game engine https://machengine.org is being written in zig, there's also https://microzig.tech as zig is well suited to embedded development.
-
Significant examples of Zig software (June 2023)?
https://github.com/hexops/mach (shameless plug)
-
Learn WebGPU
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
zig
-
Rust Kernel Policy
But the situation for Rust-C++ interop is also worse than for Rust-C interop. Why else would Google spend maybe $1 million on improving it in 2024? https://www.theregister.com/2024/02/05/google_rust_donation/ Many years after Rust got support in Mozilla for usage with Firefox written in C++.
>My sibling is also correct, language decisions were made in order to keep FFI zero overhead.
Yet overhead is only one piece of the puzzle for FFI and interop with C, or for that matter, C++.
How does Rust compare with a language with less advanced and more simple semantics and requirements of invariants, like Zig?
https://ziglang.org/
>Incrementally improve your C/C++/Zig codebase.
-
A tale of several distros joining forces for a common goal: reproducible builds
Regarding the reproducible bootstrapping problem, what is your project's policy on building from binary sources? For instance, Zig is written in zig and bootstraps from a binary wasm file which is translated to C: https://github.com/ziglang/zig/tree/master/stage1
Golang has an even more complicated bootstrapping procedure requiring to build each successive version of the compiler to get to the most recent version.
-
Zig Guide
I love Zig and I love that it’s getting attention, but can someone convince me of its memory safety? One thing that surprised me is that returning pointers to stack-allocated memory doesn’t cause a compiler error — it just segfaults at runtime. This has been an open issue since 2019 [#2646](https://github.com/ziglang/zig/issues/2646).
That, along with the number of memory-related issues in one of Zig’s most popular project, Bun.js [search: segfault](https://github.com/oven-sh/bun/issues?q=is%3Aissue+segfault), gives me pause.
-
Zig; what I think after months of using it
The duck typing argument is absolutely not based on minimal or missing documentation. There wouldn't be countless issues about it in the Zig repository if it were that simple. See https://github.com/ziglang/zig/issues/17198
I'm simply going to quote one of the comments from the linked GitHub issue:
> generic code is hard. Hard to implement correctly, hard to test, hard to use, hard to reason about. But, for better or worse, Zig has generics. That is something that cannot be ignored. The presence of generic capabilities means that generic code will be written; most of the std relies on generic code.
-
In Zig, What's a Writer?
`appendSliceOptimized` is implemented using knowledge of the underlying writer, the way that say an interface implementation in Go would be able to. It's a big part of the reason that reading a file in Zig line-by-line can be so much slower than in other languages (2)
(1) https://gist.github.com/karlseguin/1d189f683797b0ee00cdb8186...
(2) https://github.com/ziglang/zig/issues/17985
-
Ask HN: What are some software projects with impressive websites?
I am looking for some inspiration at websites for software projects that do a very good of job explaining their product right from the get go. Things like programming language or database home pages/docs or open source projects with good git READMEs.
Though I've never used it, I think https://ziglang.org/ is a great example as it explains what makes the language unique, gives a code example right at the beginning, and makes it clear where to find more samples so I can quickly judge the features of the project without having to go through the entire docs.
Maybe this is debatable, but I feel like https://kubernetes.io/ is a counter example. It's one of my favorite tools, but the home page doesn't tell me much. I think I would have liked to see code snippets about Deployments or some sort of architecture diagram that explains what it does in terms of different well established protocols like cri-o or cgroups or something.
You might disagree with my examples above, but I'm still curious to see what other people consider "good".
- LLDB for Zig
-
Development Environment Configuration
Programming Languages: Go, Rust, Zig
-
TIL: Ghostty — a new and quite promising terminal emulator
At the same time, in the internal Slack of the company I work for, my colleague asked the security team whether we have any policies about the apps, as they'd like to start using Ghostty as their terminal emulator. I took a look at it, and it immediately caught my attention: a fresh look, a zero-config setup, platform-native UI (discovered in details in the “Ghostty Is Native—So What?” post by Gregory Anders) and GPU acceleration, and FOSS with very permissive MIT license (here is the GitHub repo). I googled the author (Mitchell Hashimoto), and discovered that he is a co-founder of HashiCorp, that brought Terraform, Vargant, Consult, Vault, and others to the world. That's quite a list. And, last but not the least, Zig as the main programming language was an interesting factor as well.
-
C++ or Rust? I'd stick to my good old C++
I'm not sure which language will be more mainstream in the future between these two. Maybe Zig(https://ziglang.org) can be some contender in the future, but not now at least - it could be a good contender at least it shows OOP grammar as simple as Python, internalizing vtable. For C++ and Rust, at least for me Rust is more like "you MUST do this" while C++ is like "you CAN do it also in this way." While one is highly opinionated, the other is unopinionated at all(that is to say, at least for me. your opinions are always welcome). And that may be one of the reasons that I don't like Qt? :D Maybe C++ is still superset of Rust in some way (it's just "in some way", because there are things unique in Rust language itself. For example, Rust trait can be mimicked with template class and combination of C++ enum and template class can behave like class-associated Rust enum, but C++ doesn't have anything equivalent or similar to borrow checker).
What are some alternatives?
quickjs-emscripten - Safely execute untrusted Javascript in your Javascript, and execute synchronous code that uses async functions
Odin - Odin Programming Language
SDL.zig - A shallow wrapper around SDL that provides object API and error handling
v - Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
arocc - A modern fully featured C compiler.
ssr-proxy-js - A Server-Side Rendering Proxy focused on customization and flexibility!
glibc_version_header - Build portable Linux binaries without using an ancient distro
go - The Go programming language
ComLightInterop - Cross-platform COM interop library for .NET Core 2.1 or newer
Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
mach-glfw-vulkan-example - mach-glfw Vulkan example
rust - Empowering everyone to build reliable and efficient software.

