News for hackers. Stuff that matters.
Re:Zig gamedev project – left my job to build games in Zig lang by collegeburner on Sunday October 17, 2021 @11:28PM (#28901970)
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 by dnautics on Monday October 18, 2021 @12:06AM (#28902135)
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 by runevault on Sunday October 17, 2021 @11:47PM (#28902052)
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 by actuallyalys on Monday October 18, 2021 @12:15AM (#28902175)
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 by runevault on Monday October 18, 2021 @08:57AM (#28904933)
Is that part paid in the Rust or LLVM portion of the compiler chain?
Re:Zig gamedev project – left my job to build games in Zig lang by dnautics on Monday October 18, 2021 @10:50AM (#28905994)
rust portion. For example, LLVM has no internal concept of ownership.
Re:Zig gamedev project – left my job to build games in Zig lang by actuallyalys on Monday October 18, 2021 @09:04PM (#28913792)
That's true of borrowing, but I'm not sure if it's true for other abstractions. I imagine generics (due to monomorphization) adds to the burden on the LLVM side.