News for hackers. Stuff that matters.
Re:Zap – Blazingly fast backends in Zig by bsder on Wednesday June 14, 2023 @06:09PM (#36333471)
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.

Re:Zap – Blazingly fast backends in Zig by Oreb on Wednesday June 14, 2023 @07:23PM (#36334279)
Can Zig also be used to compile static libraries for iOS and Android?
Re:Zap – Blazingly fast backends in Zig by bsder on Wednesday June 14, 2023 @07:46PM (#36334486)
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-...