Re:Zig is now also a Windows resource compiler
by layer8 on Sunday October 22, 2023 @07:47AM
(#37974548)
Win32 resources are much more than that. They have names and type information associated with them, and they can be multilingual (see e.g. [0]). A rich runtime API is provided to dynamically find and load resources from executables/libraries. You can distribute a resource library that other programs can statically link in or dynamically load. Basically, itβs an ABI for resources, including localization support and a schema for UI-related resource types.
Re:Zig is now also a Windows resource compiler
by begoon on Saturday October 21, 2023 @06:54PM
(#37971234)
This feature of Go tool chain is so underrated. Yes, there is nothing magical here. I can achieve similar outcome with some custom preprocessing, but having it built into the ecosystem, with type checking and inferencing, single binary compilation, etc. is a great productivity booster.
Re:Zig is now also a Windows resource compiler
by o11c on Saturday October 21, 2023 @06:34PM
(#37971113)
You can use `objcopy`, `as`, or `ld`. There are several ways, some of which even allow setting the symbol size (which most people never care about, but sometimes matters for nerds introspecting your object files).
Re:Zig is now also a Windows resource compiler
by lmz on Sunday October 22, 2023 @10:49PM
(#37981067)
Yeah but the original post was talking about "Linux" which doesn't really have any use for that on the kernel level. I also doubt Freedesktop are going to specify special ELF sections or something for icons.
https://docs.gtk.org/gio/struct.Resource.html
I was wrong on C++ side, apparently it is on track for C++26.
[0] https://learn.microsoft.com/en-us/windows/win32/api/winbase/...
> I also doubt Freedesktop are going to specify special ELF sections or something for icons
They should. It would stop my icons from disappearing / changing on me while Iam not looking.