5 ms·
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
by dnautics 5y ago
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.)
- genocidicbunny 5y agoThe C interop is especially useful for gamedev since so many libraries have a C interface and thus can be relatively easily used in Zig.
- collegeburner 5y agoIntersting, 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?
- runevault 5y agoPart 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.
- actuallyalys 5y agoPart 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.
- runevault 5y agoIs that part paid in the Rust or LLVM portion of the compiler chain?
- dnautics 5y agorust portion. For example, LLVM has no internal concept of ownership.
- actuallyalys 5y agoThat'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.
- dnautics 5y ago1. 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.
- deleted 5y ago[deleted]