I really like what they've done for cross-compilation. Automatically selecting appropriate libc/crt implementation is such a relief. Compared to Zig, cross-compilation in C/C++/Rust seems downright user-hostile: you have to obtain the correct cross-sdk, but it won't tell you which one, or how to get it (some combos don't even exist), or even where to put it. If you don't guess everything correctly, it will fail with…
I would not include Rust in that list, in my experience rustup and cargo are miles ahead of C/C++ when cross compiling.
Zig cc: A drop-in replacement for GCC/Clang (2020)
21–30 of 126 posts
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#22>The major theme of the 0.9.0 release cycle will be stabilizing the language, creating a first draft of the language specification, and self-hosting the compiler.
So I am guessing we could see 1.0 release within 12 months time? Or will there be 0.10 or 0.11 after that?
I am just eager to hear people's comments and opinions for using it in production within their context and edge cases.
And as a sort of side note, I quite like the momentum and the way Andrew has been handling Zig's PR. I just hope and pray HN keep that tradition, dont over hype it.
[1] https://ziglang.org/download/0.8.0/release-notes.html#Roadma...
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#23I’ve been learning Zig for a few months now and what I’m in love with is the ability to just use Zig to interact with whatever C libraries I want, but doing so with the conveniences that Zig offers. I want to use SDL2 and cairo and pango? No problem! GTK4, easy peasy! There’s a C lib that comes as a single .c file that makes it easier to interact with SDL? Drop it on the project folder and compile it with Zig along a…
Valgrind is also more useful than just for C, although admittedly it's most useful for binaries that have parts written in unchecked languages like C.
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#24I really like what they've done for cross-compilation. Automatically selecting appropriate libc/crt implementation is such a relief. Compared to Zig, cross-compilation in C/C++/Rust seems downright user-hostile: you have to obtain the correct cross-sdk, but it won't tell you which one, or how to get it (some combos don't even exist), or even where to put it. If you don't guess everything correctly, it will fail with…
I don't know much about cross compilation, but in terms of the Rust case, could part of it be the relative complexity of the language compared to Zig?
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#25Earlier quoted context omitted.
I don't know much about cross compilation, but in terms of the Rust case, could part of it be the relative complexity of the language compared to Zig?
`zig cc` cross-compiles C, not Zig.
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#26I’ve been learning Zig for a few months now and what I’m in love with is the ability to just use Zig to interact with whatever C libraries I want, but doing so with the conveniences that Zig offers. I want to use SDL2 and cairo and pango? No problem! GTK4, easy peasy! There’s a C lib that comes as a single .c file that makes it easier to interact with SDL? Drop it on the project folder and compile it with Zig along a…
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#27I really like what they've done for cross-compilation. Automatically selecting appropriate libc/crt implementation is such a relief. Compared to Zig, cross-compilation in C/C++/Rust seems downright user-hostile: you have to obtain the correct cross-sdk, but it won't tell you which one, or how to get it (some combos don't even exist), or even where to put it. If you don't guess everything correctly, it will fail with…
Since advent of multiarch, crosscompilation does not seem harder than regular compilation. Just install package with gcc for target arch and required libraries for target arch (using the same way as gcc and libraries for host arch).
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#28From Release Note 0.8 Roadmap [1], >The major theme of the 0.9.0 release cycle will be stabilizing the language, creating a first draft of the language specification, and self-hosting the compiler. So I am guessing we could see 1.0 release within 12 months time? Or will there be 0.10 or 0.11 after that? I am just eager to hear people's comments and opinions for using it in production within their context and edge cas…
1.0 is going to take a lot longer than that.
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#29`zig cc` is also amazing to compile C and C++ code to WebAssembly. For standalone WebAssembly or WASI. No need to install yet another toolchain, this is just another target Zig can compile to, out of the box.
Emscripten just installs a bunch of stuff to make it easier to use existing libraries.
If you just want to use standard library, no need for extra stuff.
Re: Zig cc: A drop-in replacement for GCC/Clang (2020)
#30Earlier quoted context omitted.
`zig cc` cross-compiles C, not Zig.
No but I mean why the Zig cross compilation story is better than Rust according to this thread