Hacker News new | past | comments | ask | show | jobs | submit login

Well, Python, JS and Go all have different goals than Zig. You also can't write low-level stuff with them, mostly. Actually, you can (with TinyGo and MicroPython), but they're not what these languages are designed for so you'll most likely be on your own.

Rust is a whole another conversation. You can pretty much do whatever you can do in Zig with Rust, and Rust has the advantage of hardcore memory safety using the borrow checker. It is also a very nice language to use, but it is complicated.

You see, Zig is sort of the C to Rust's C++. I don't mean this in the sense that Zig can't replace C++ (it can) or Rust can't replace C (it can), but it is obvious that C is a simpler language to learn than C++.

So yeah, you kind of don't need Zig when you have Rust and willing to use it for everything, but if you don't want to deal with a complicated language and the borrow checker, Zig is the language for you. It is basically C with some footguns removed + some features added (tagged unions, proper error handling, etc).

Ah, and Rust has long compile times. It is being worked on since 2013 [0] or earlier. Zig is serious about their compile times as you can read about the self-hosted backends for debug compilation speed in the release notes.

I don't know if Rust has any production-ready alternative backends that are fast. People always say LLVM is the reason Rust is slow to compile and you can use cargo check to confirm that, but it is obvious that is more of a priority for Zig team when compared to Rust team.

I sort of don't care about compile times of Rust at this point since the guarentees Rust make is more important to me than the compile times, but that may not be the case for everyone. I'll also use Zig when it is stable enough for my taste for non-safety critical stuff.

[0] https://news.ycombinator.com/item?id=6537005




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: