Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Zig is mostly a good alternative to C.

If Rust or C++ are possible options, Zig probably isn't what you really want. Rust is especially good if you can keep everything in Rust and make the most of the ecosystem.

I like Zig, but it is a much smaller language that C++ or Rust with more than a few very, very sharp edges. That having been said, I reach for Zig in a lot more instances than I thought I would. I write a lot of relatively small programs that I want to work on Linux/Windows/macOS, and Zig is pretty good at that.

Of course, I miss Rust terribly every time I run a Zig program and get a segfault.



Can Zig also be used to compile static libraries for iOS and Android?


There's no good reason why not. Zig is, after all, a full C compiler so it can certainly create C libraries.

You can create a full Zig program to run on Android: https://archive.fosdem.org/2021/schedule/event/zig_android/

iOS: https://www.jakubkonka.com/2022/04/30/ios-dx-with-zig-milan-...




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

Search: