Re:Zig cc: A drop-in replacement for GCC/Clang (2020)
by kevin_thibedeau on Sunday July 18, 2021 @02:31PM
(#27875238)
> illegally reverse engineering Metal bytecode
Reverse engineering is legal in the US (unless bound by contract).
Re:Zig cc: A drop-in replacement for GCC/Clang (2020)
by Cloudef on Sunday July 18, 2021 @10:46PM
(#27878756)
The metal compiler probably could run with darling
Re:Zig cc: A drop-in replacement for GCC/Clang (2020)
by pcwalton on Sunday July 18, 2021 @03:11PM
(#27875625)
So does every new release of any Windows component require a new version of Zig? That doesn't seem sustainable.
Re:Zig cc: A drop-in replacement for GCC/Clang (2020)
by flohofwoe on Sunday July 18, 2021 @03:42PM
(#27875963)
I don't actually know what Windows components mingw supports in detail and how often mingw is updated because of that, but I guess that the important Win32 APIs are stable. I suppose that the new APIs which are highly in flux could be supported by separate packages, like this: https://github.com/marlersoft/zigwin32)
The system API problem can be solved by shipping automatically generated API bindings (similar to what Microsoft does with the Rust bindings to the Windows APIs, a similar project for Zig is underway). Once those bindings exist, no Windows SDK is needed anymore and cross-compiling should "just work".
PS: Zig actually ships with the mingw headers in the default installation (e.g. windows.h, d3d11.h, dxgi.h etc are all there), I haven't actually tried to cross-compile a Windows executable using the Win32 APIs though, but it looks like it should work already.