News for hackers. Stuff that matters.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by pcwalton on Sunday July 18, 2021 @03:10PM (#27875620)
Right. Are you going to ship all Windows headers and import libraries to everyone, including DirectX, etc.? Are you going to keep them up to date with every new version of a Windows component? Are you going to ship parts of the macOS, or iOS SDKs?

I don't see shipping all targets all the time to be a particularly scalable solution in general. When you start including all libraries necessary to develop actual apps, the download size will eventually get so big that people will complain. Just make it easy for developers to get the targets they need, but don't ship everything by default.

Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by slimsag on Sunday July 18, 2021 @04:39PM (#27876474)
I'd argue it's less about what the compiler does by default, but rather what it (and the community) enable.

For Mach (the Zig game engine I'm working on), I have a Zig build script which fetches the required parts of the macOS and iOS SDKs from GitHub to enable cross compilation from Windows/Linux -> macOS. Zig's linker, zld, enables that to work easily.[0]

For SDL.zig, they have also achieved cross compilation for most targets out of the box[1].

Contrast this to say, Go or Rust, where most GLFW and SDL bindings require mucking around with the system dependencies. It doesn't just work out of the box, I think that's really unfortunate and hope other languages work more towards painless installation of C-binding dependencies.

[0] https://twitter.com/slimsag/status/1413770578494775298

[1] https://github.com/MasterQ32/SDL.zig#support-matrix

Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by p0nce on Sunday July 18, 2021 @03:17PM (#27875708)
> Just make it easy for developers to get the targets they need, but don't ship everything by default.

It seems to be what Flutter is doing, and it must be a ton of work.

Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by flohofwoe on Sunday July 18, 2021 @03:48PM (#27876025)
I'd guess once Zig gets its package manager many target-specific packages can move out of the default installation.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020) by pcwalton on Sunday July 18, 2021 @03:58PM (#27876114)
Absolutely, which is exactly what I'm arguing for. :)