3 ms·
Somewhat related, how does Zig compare to Rust? I've been learning Rust but also saw Zig gaining traction. I believe the JS runtime Bun is written in Zig which
by cercatrova 4y ago
Somewhat related, how does Zig compare to Rust? I've been learning Rust but also saw Zig gaining traction. I believe the JS runtime Bun is written in Zig which was on HN last week.
- dralley 4y agoIt tends to break down along the same lines as the C vs. C++ debate from 15 years ago. People who are willing to accept a lot of complexity in order to solve certain problems or gain expressiveness tend to prefer Rust. It's a complex language with a rough learning curve and not-great compile times, but it does help solve some really difficult problems. People who prefer simpler, more straightforwards languages (like C and Go) tend to prefer Zig. The core of the language is much smaller and more C-like, the (new) compiler is really fast and uses less memory in comparison to Rust or C++. The selection of features it does provide is very tasteful and clever in a way that has been really impressive. They do a huge amount with very little. e.g. * macros are avoided entirely by using compile time code evaluation and dead code elimination * "generics" are implemented by using types as function arguments (no special syntax to learn) and compile time code evaluation