Re:Zig, parser combinators, and why they're awesome
by lhorie on Thursday March 11, 2021 @03:25PM
(#26428588)
Linking to the system curl is indeed very easy, just pass `--library curl`, but cross-compiling means you can't just do that (since e.g. a windows dll is not going to work on macos). Instead you need either source code or a `.o` file.
Compiling C source is "easy" in the sense that the compiler can do it without huffing and puffing, but it comes with a bit of yak shaving (namely, setting up build.zig or fiddling w/ the respective CLI flags, and obviously you also need the actual source code files to be in the right place, etc.) It also means that maybe the memory allocation scheme will not be quite what you want (e.g. you can't pass your arena allocator to curl_easy_cleanup)
But that should be very easy in zig, as zig can compile c?
https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...