What does HackerNews think of zig-gamedev?

Building game development ecosystem for @ziglang!

Language: C

Zig compiler provides working cross-compilation out of the box.

zig-gamedev project provides Win32/D3D12 API bindings that can be used on Windows and Linux.

Wine with VKD3D-Proton provides robust solution for emulating Windows runtime.

Above components combined together gives very nice development environment for building DirectX 12 applications on Windows and Linux.

Project homepage: https://github.com/michal-z/zig-gamedev

Minimal DirectX 12 application that can be developed on Windows and Linux: https://github.com/michal-z/zig-gamedev/tree/main/samples/mi...

Language-level guarantees of memory safety are not critical to all low-level programmers, and sometimes this is fine!

Developers of games, compilers, digital audio workstations, video editors, and live performance software (such as openFrameworks) likely don't rank memory safety as their top concern.

Zig is already an attractive choice for those domains because it offers:

- Great compile times compared to C++/Rust, and future plans to implement hot reloading as a core part of the tooling: https://www.jakubkonka.com/2022/03/16/hcs-zig.html

- The ability to reason about where data exists in memory: https://ziglang.org/documentation/master/#Where-are-the-byte...

- Good readability and learnability, especially if you have a C/C++ background.

- Comptime that enables clean generics, compile-time reflection and general metaprogramming as a happy side-effect: https://kristoff.it/blog/what-is-zig-comptime/

- Better tooling than C/C++. The ability to cross-compile Zig and C/C++ from one machine lets you set up much more stable and reproducible build environments already. You can clone zig-gamedev and have the demos working with just three commands on Windows/macOS/Linux, for example, and two of those three are cloning the repo and changing to the directory: https://github.com/michal-z/zig-gamedev (to build the examples you will need the latest copy of Zig from the 'master' section for your platform at https://ziglang.org/download/ )

We should all be careful about insinuating that memory unsafe languages should not exist. I see “friends don't let friends use memory-unsafe languages” on social media and feel sick. It's much healthier to embrace the melting pot of Zig, Odin, D, Beef, Vale, Hare, V, Lobster, Jai, C3, Val, Roc and all the rest and see what new ideas and trade-offs they bring.

Also worth noting that new languages tend to take time to develop their own philosophies to memory safety (Vale's approach is only just now emerging, for example: https://verdagon.dev/blog/making-regions-part-1-human-factor ). Others take years to gradually improve and develop techniques for better memory safety (like D). Zig's story might not be as good as Rust's ( https://www.scattered-thoughts.net/writing/how-safe-is-zig/ ), but then it's not Zig's priority at the moment, and Zig's full story is not yet written. Even if Zig's safety features don't improve further between now and 1.0, it already has great value as a language.

Most game engines are probably written in C++, with scripting done in C#, Python, Lua or a custom language.

But all languages are used. Minecraft was written in Java. A guy called Michal Ziulek is working on game development ecosystem for Zig, which I think is really neat.

https://github.com/michal-z/zig-gamedev

I'm using Zig, but this all sounds like being able to hot swap in Lisp dev, especially for games. I fermenter someone using Gambit and iPhone for game dev in 2010 or so pulling this off. This seems more complicated in comparison. I'm playing with this: https://github.com/michal-z/zig-gamedev

Mach for Zig looks interesting too, but it's very new.

I agree, and much easier than Rust to get going and then some. Other than playing with Nannou in Rust to 'get' the language, and the Rust book, I started a toy game in Zig without more than the skeleton put together here:

https://github.com/michal-z/zig-gamedev

I like Raylib, and there are bindings for most popular languages, but I like the minimalism I can start with fairly quickly in Zig. I tried Bevy for Rust, but it is a lot more involved, and Rust, so Zig it is for now.

For safety, and high-integrity software, I am sticking with SPARK2014. Rust will get there soon, but Ada/SPARK2014 have such a lead, maturity, and industry take up that I am putting Rust down for another year or more.

I continue to build game development ecosystem for Zig programming language.

Zig gamedev project home: https://github.com/michal-z/zig-gamedev

New physics demo: https://github.com/michal-z/zig-gamedev/tree/main/samples/bu...

Prebuilt binaries for all demos: https://github.com/michal-z/zig-gamedev/releases/download/v0...