External Publication
Visit Post

Fork `basement`? As `baseplate`?

Haskell Community [Unofficial] March 8, 2026
Source

In basically any other language as well, foreign bindings to curl or the like are how http is often done, and even then, in those languages, shelling out to curl is significantly more robust. It is simply that because haskell cares more about code that is both statically compiled and cross-platform the desire for a fully native library is stronger.

That said, let me explain, based on experience, why shelling out to curl is more robust than linking libcurl. Libcurl has the basic power in terms of protocol and settings as curl-the-executable of course. However, it does not have those settings configured as users would desire them. It needs special flags or multiple calls to discover where certificates are and load them robustly, to follow redirect paths which the binary client will follow automatically, etc. This is particularly striking/onerous with proxy settings, where depending on OS and version, they may be in a ton of different places, in one of a few formats. Libcurl doesn’t automatically search all the different places different systems may have proxies configured (especially in the presence of proxies set by endpoint security systems), but the executable has that additional logic wired in. The library is a swiss-army-knife for configuring and then making precise HTTP calls, but the executable is the tool that is able to interpret “do all the things you need to in order to retrieve this remote file” which is a much broader task. Effectively, no matter what language you are in, if you want to make your program robust under the greatest number of possible end-user situations, then you will be best served by shelling out to curl.

Discussion in the ATmosphere

Loading comments...