The more I hear about Zig, the more I appreciate it. Its vertically integrated stack (with the custom linker and code-generation backends) stands out to me as a really compelling feature that enables interesting optimizations. The compiler is also much easier to interact with in a consistent way compared to C. I've been using it as an experimental backend for my language project with great results.
I've been writing Zig since the beginning of the year. Just playing around with some small stuff really. I want to love the language. It does so much right, but there's something about it just feels off to me. And then the recent Io change really bugged me.
> I've been using it as an experimental backend for my language project with great results.
One annoyance that I've ran into when using Zig as a transpiler backend is the lack of unstructured goto. Many languages don't need that, but if you're dealing with the one that does, converting such code is non-trivial.
I don't really have much interest in Zig the language, but Zig as a standalone C/C++ compiler is pretty great.
I'm using it as a cross-compiler for linux-arm64 because its much simpler to download a single archive and extract it somewhere than to waste a bunch of time on guessing how each different Linux distro does ARM64 cross compilers (or doesn't in the case of Fedora).
I’ve been using it for an embedded project to target arm thumb and the typical x86-64 hosts that communicate with a protobuf based protocol. It’s absurdly convenient to be able to just give windows users the repo, zig binary, and tell them to run ‘zig build’.
Looking in the source tree, it doesn't look like it has it's own entry point. Zig is heading in the direction of a very verticall integrated compilation stack (I believe this is where most of the speed up comes from), so I'm not really sure of the utility with using it outside of the Zig world.
If I recall correctly, this is one of the final pieces that allows zig to be used as a fully self-contained cross-compiling C toolchain (once its linker is enabled for more platforms / formats)
I might be misunderstanding, but I don’t think that's quite accurate. As I understand it, Zig ships a Clang frontend and wraps it with precompiled sysroots. Unless they're developing an LLVM backend, I'm not sure how it could serve as a completely self-contained toolchain.
[+] [-] olivia-banks|5 months ago|reply
[+] [-] scuff3d|5 months ago|reply
[+] [-] int_19h|5 months ago|reply
One annoyance that I've ran into when using Zig as a transpiler backend is the lack of unstructured goto. Many languages don't need that, but if you're dealing with the one that does, converting such code is non-trivial.
[+] [-] rstat1|5 months ago|reply
I'm using it as a cross-compiler for linux-arm64 because its much simpler to download a single archive and extract it somewhere than to waste a bunch of time on guessing how each different Linux distro does ARM64 cross compilers (or doesn't in the case of Fedora).
[+] [-] wolvesechoes|5 months ago|reply
The more Zig-the-language is hyped, the more I see it doesn't bring anything of interest. Zig-the-toolchain, on the other hand, is neat.
[+] [-] davemp|5 months ago|reply
[+] [-] wild_egg|5 months ago|reply
[+] [-] squirrellous|5 months ago|reply
Does anyone know if it’s reasonably easy to use elf2 as a standalone linker in a c/c++ toolchain? Or is it specially built just for Zig?
[+] [-] olivia-banks|5 months ago|reply
https://github.com/jacobly0/zig/tree/4508c2543508e04253471e1... https://github.com/jacobly0/zig/blob/4508c2543508e04253471e1...
[+] [-] dmit|5 months ago|reply
No kidding. There are also https://github.com/davidlattimore/wild and https://github.com/kubkon/bold.
[+] [-] esbranson|5 months ago|reply
[+] [-] brcmthrowaway|5 months ago|reply
[+] [-] edoceo|5 months ago|reply
[+] [-] chris_armstrong|5 months ago|reply
[+] [-] olivia-banks|5 months ago|reply
[+] [-] L0Wigh|5 months ago|reply
[+] [-] dustbunny|5 months ago|reply