News for hackers. Stuff that matters.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by steveklabnik on Sunday July 18, 2021 @11:00AM (#27873492)
Personally, I see it in three tiers: Rust improved upon those experiences, but I still wish someone would implement what Zig has in rustc.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by vvanders on Sunday July 18, 2021 @12:32PM (#27874240)
Yup, fully agreed Zig stands above others here. Cross compiling C/C++ is just a special kind of hell. Each target always has some sort of bespoke toolchain and build environment constraint that add so much unneeded complexity.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by pcwalton on Sunday July 18, 2021 @03:12PM (#27875647)
I don't. We could approximate it by shipping all targets by default, but few really want that and the few who do can just install those targets with rustup.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by steveklabnik on Sunday July 18, 2021 @05:15PM (#27876750)
Sure, like many things, I bet you could pick three or four and get 90% of the default coverage. That still helps 90% of the users.

I also think you're really missing out on the "compile C code easily too" thing. That isn't very pleasant at all in Rust today.

(Finally, one reason it’s so big is that we ship binaries. This ships source. std-aware cargo could really help here.)

Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by littlestymaar on Tuesday July 20, 2021 @03:13AM (#27890877)
> I also think you're really missing out on the "compile C code easily too" thing. That isn't very pleasant at all in Rust today.

So much this. Cross compiling pure Rust code is really easy today but as soon as you have a C dependency in your dep tree, you're gonna have a bad time.

Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by nicoburns on Sunday July 18, 2021 @04:20PM (#27876320)
Is it really few who want that? Anybody developing server software on windows or mac and deploying on linux could use this. Anybody developing cross-platform client software could use it.

I'd guess that a lot of Rust developers currently do development on their target platform, but that's because cross compiling is such a pain. If it were as easy as zig or go then things might well be differen.

Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by pcwalton on Sunday July 18, 2021 @05:16PM (#27876753)
My x86_64 Rust libraries directory is 86MB. `rustup target list | wc -l` spits out 84 for me. The math doesn't add up.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by nicoburns on Monday July 19, 2021 @09:28AM (#27882412)
Is rust cross-compilation really is straightforward as just installing the target triple and then it "just works" (including linking and C FFI compilation)?

My understanding was that most people were using "cross" docker images for "cross-compilation", because setting up native actual cross-compilation was quite involved.

Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by burntsushi on Monday July 19, 2021 @10:07AM (#27882789)
No, it isn't that easy. pcwalton is misrepresenting things here IMO.

Yes, people, including myself, use 'cross' precisely because it isn't as easy as "just use rustup to install the desired target." 'cross' has a bunch of Docker images that set up the cross compilation toolchains, and those images represent a fair amount of domain knowledge that I don't have to tediously acquire to use it.