2 ms·
A few big benefits off the top of my head: * A concurrency mechanism that's very easy to use, because it doesn't have the function coloring problem of async/aw
by verdagon 4y ago
A few big benefits off the top of my head:
* A concurrency mechanism that's very easy to use, because it doesn't have the function coloring problem of async/await.
* Extra assistance with memory safety, via its "release-safe" mode. Not a silver bullet, but it does help!
* Good tooling; zig cc can cross-compile from any major OS to any major OS.
* Comptime, a pretty brilliant system that does what generics does for other languages, with a fraction of the complexity.
- dleslie 4y agoI've never had a problem with concurrency in C, really. async/await in other language is fine and all, and I've had my fair share of them there, but I wonder if the difficulty in reasoning about them is worthwhile wherever I use C. I'm more likely to want something declarative and explicit than async/await. Again, memory safety has never really been a problem for me where I use C; and if I want it, I'd want something as strong as Rust's borrow checker or at least the smart pointers of C++. zig cc can't cross-compile on all platforms, particularly not esoteric and proprietary embedded targets or game hardware, and so that's a nothingburger for me.
- throwawaymaths 4y agoZigs async/await is not really a concurrency construct (though you can use it as the basis for a work stealing scheduler), it's something much more fundamental and close to the metal.