Live data from Hacker News

Zig gamedev project – left my job to build games in Zig lang

github.com

21–30 of 126 posts

Re: Zig gamedev project – left my job to build games in Zig lang

#21
post #5

Earlier quoted context omitted.

Why not Zig? Its a pretty fun language...

Well there are still quite a lot of compiler bugs. I personally have open issues going back as far as 2018. Knowing the compiler has bugs and that new ones are constantly being discovered makes debugging a pain because you have a lot less confidence that the problem is your code. I have many times blamed the compiler for my mistakes, something I've almost never done with C.

> I have many times blamed the compiler for my mistakes, something I've almost never done with C.

Early on, I remember dealing with lots of bugs in C compilers in the mid and late 80s. It takes time.

Re: Zig gamedev project – left my job to build games in Zig lang

#22
post #2

I'm using Zig language full-time to create an indie game. Also, I've created zig-gamedev project to build game development ecosystem for this language. Using DirectX 12 for rendering, Bullet for physics. I'm ex-AAA game developer and graphics programmer.

Any plans for multi-platform in the future?

Re: Zig gamedev project – left my job to build games in Zig lang

#23
post #3

Earlier quoted context omitted.

Why Zig?

Not OP, but here is what I can think of: - Low level - great C interop - Good toolchain ergonomics, except for no pkg manager yet - Great cross-compilation - Fast compilation (incremental coming soon) - Ideal for things where ownership rules can get complicated (ECS e.g.)

Intersting, some follow up questions:

- Fast compilation: isn't it llvm? So how faster compared to C++/Rust/others that use it?

- Ownership rules/ECS: what about zig makes this especially good? The only language that comes to mind in this respect is Rust and its borrow checker, is it similar in Zig?

Re: Zig gamedev project – left my job to build games in Zig lang

#24

Earlier quoted context omitted.

Not OP, but here is what I can think of: - Low level - great C interop - Good toolchain ergonomics, except for no pkg manager yet - Great cross-compilation - Fast compilation (incremental coming soon) - Ideal for things where ownership rules can get complicated (ECS e.g.)

Intersting, some follow up questions: - Fast compilation: isn't it llvm? So how faster compared to C++/Rust/others that use it? - Ownership rules/ECS: what about zig makes this especially good? The only language that comes to mind in this respect is Rust and its borrow checker, is it similar in Zig?

Part of Rust's problem last I knew was it throws a lot more than it necessarily has to at the LLVM backend. So a front end that takes the time to lessen the burden could run faster despite using the same tooling.

Re: Zig gamedev project – left my job to build games in Zig lang

#25

Earlier quoted context omitted.

Not OP, but here is what I can think of: - Low level - great C interop - Good toolchain ergonomics, except for no pkg manager yet - Great cross-compilation - Fast compilation (incremental coming soon) - Ideal for things where ownership rules can get complicated (ECS e.g.)

Intersting, some follow up questions: - Fast compilation: isn't it llvm? So how faster compared to C++/Rust/others that use it? - Ownership rules/ECS: what about zig makes this especially good? The only language that comes to mind in this respect is Rust and its borrow checker, is it similar in Zig?

1. Both zig and rust compile to intermediate representations which are then compiled to llvm IR. Most of the compilation woes of rust are in the early stage IR.

2. Zig doesn't have ownership rules, which can get in the way of important data structures for gaming.

Re: Zig gamedev project – left my job to build games in Zig lang

#26

Earlier quoted context omitted.

Intersting, some follow up questions: - Fast compilation: isn't it llvm? So how faster compared to C++/Rust/others that use it? - Ownership rules/ECS: what about zig makes this especially good? The only language that comes to mind in this respect is Rust and its borrow checker, is it similar in Zig?

Part of Rust's problem last I knew was it throws a lot more than it necessarily has to at the LLVM backend. So a front end that takes the time to lessen the burden could run faster despite using the same tooling.

Part of it (perhaps the majority) is excessive intermediate code. But at least some of it is that Rust's abstractions are more complex/involved. The "zero cost" doesn't refer to compilation time.

Re: Zig gamedev project – left my job to build games in Zig lang

#27

Zig is a really interesting language for game dev. I was thinking about using Zig with raylib for my next project. The show stopper was that C ABI compatibility is not yet complete: https://github.com/ziglang/zig/issues/1481 I could have probably worked around it but decided to go the C and Lua for scripting route for now which works great but I can totally see Zig as a decent C replacement. I am not interested in Wi…

One of the nicer things about Zig is that the unoptimized debug binaries are still pretty fast, often only 2 or 3 times slower than the optimized ones rather than 10+ times slower. Presumably because Rust and C++ have a lot of abstractions that have to be sent through the optimizer to be truly "zero-cost".

That, combined with generally really fast compiles (again relative to C++ and Rust) is a nice combination for game devs.

Re: Zig gamedev project – left my job to build games in Zig lang

#28

I think Zig is great and I'm following it with interest. But I think people should be aware that it is not really stable yet, at least in my experience from trying it earlier this year. I ran into a compiler crash: https://github.com/ziglang/zig/issues/7865 . I attempted to fix the compiler crash myself ( https://github.com/ziglang/zig/pull/8372 ), and I found a fix that worked, but apparently it was not the right fi…

Why would they spend the effort on writing the zig compiler in zig?

Re: Zig gamedev project – left my job to build games in Zig lang

#29

I think Zig is great and I'm following it with interest. But I think people should be aware that it is not really stable yet, at least in my experience from trying it earlier this year. I ran into a compiler crash: https://github.com/ziglang/zig/issues/7865 . I attempted to fix the compiler crash myself ( https://github.com/ziglang/zig/pull/8372 ), and I found a fix that worked, but apparently it was not the right fi…

I tried, and enjoyed, Zig. My enjoyment rapidly fell off a cliff when I started getting deeper into the stdlib. It feels like (this may not be true) that people contributed random stuff into it, a bit like C++ prior to Boost. The inconsistency hampered my enjoyment, and I headed back to Rust.

Re: Zig gamedev project – left my job to build games in Zig lang

#30
As a former game developer, I don't get why the people start from scratch by developing their own rendering engines or even game engines. Using Unity, Unreal or even Godot is helping you to launch your game 100x faster.

I know it might be fun to develop your own engine but it will take a lot of time and it still won't be as usable as an engine developed by 100x more engineers.

Post reply on HN