by michal-z · 5y ago · 0 comments
Full time indie is a fun and scary adventure at the same time, good luck!
One question, why DX 12? i'm kinda sad when i see indie choose proprietary non-portable tech..
Not to say that vulkan is better (i hate it), but i'm curious
We solved this issue already with WebGPU, it uses what ever is native to the platform you target..
https://devlog.hexops.com/2021/mach-engine-the-future-of-gra...
Everyone wins
Switch uses GL/Vulkan
And the PS4/5 uses something akin to Vulkan
On PC Vulkan is probably more used than DX12, i can't remember the time i seen DX12 in a setting.. i think i only seen it once..
- 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.)
- 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?
2. Zig doesn't have ownership rules, which can get in the way of important data structures for gaming.
For example, Zig offers spatial memory safety, and provides test allocators to catch temporal memory safety issues. That's already an order of magnitude improvement over C.
Memory safety is also just one aspect of safety, whereas sometimes programmers conflate the two. It's important, but things like checked arithmetic should also be right up there, and should be enabled by default in safe build modes. I think Zig's approach here is also spot on, having worked a little in security, where an integer overflow can be almost as dangerous as a buffer overflow. Yet I don't see many other languages taking checked arithmetic as seriously as Zig does.
While there is some truth to that, if that's the only analysis you're willing to do, then you're going to fail spectacularly hard at recognizing the advantages of TypeScript over JS, for example. Zig and C share a similar relationship across many axes, including memory safety.
Otherwise it is pretty much Modula-2, with C flavoured syntax and compile time execution.
Overall, the use-after-free is what irks me.
Early on, I remember dealing with lots of bugs in C compilers in the mid and late 80s. It takes time.