Curl 8.0.0
daniel.haxx.se
daniel.haxx.se
There's probably a fair number of setups that more-or-less automatically upgrade to the next minor version, but not the next major.
I don’t know why, but this really, really bothers me. Why even use semver then?
They don’t?
> This is not a new or revolutionary idea. In fact, you probably do something close to this already. The problem is that “close” isn’t good enough. Without compliance to some sort of formal specification, version numbers are essentially useless for dependency management.
Thus, X.Y.Z does not automatically mean "semver". Nor does even X.0.0 mean semver.
To give some 20th century counter-examples found through Google Scholar:
"System Description: Spass Version 1.0.0" (1999) https://link.springer.com/chapter/10.1007/3-540-48660-7_34
"This is version 2.0.0 of the software." (1999) https://econpapers.repec.org/software/bocbocode/s365703.htm
"This report provides the NIKE3D user's manual update summary for changes made from version 3.0.0 April 24, 1995 to version 3.3.6 March 24, 2000" - https://www.osti.gov/servlets/purl/15004757
You’ve got the order of events all mixed up.
“Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY also include minor and patch level changes. Patch and minor versions MUST be reset to 0 when major version is incremented.”
Curl on changes in 8.0.0:
“There is only one actual “change” in this release. This is the first curl release to drop support for building on a systems that lack a working 64 bit data type. curl now requires that ‘long long‘ or an equivalent exists.”
This is a backwards-incompatible breaking change, though not to the public API (but I believe semver as used is understood to include ABI, supported environments, etc), and it’s likely only “theoretically” breaking (are there any existing platforms that don’t have 64-bit support that did build curl, and now can’t? Looks like Daniel posed this question back in Sep 22 and found there were not https://curl.se/mail/lib-2022-09/0099.html).
So semver is not respected to the letter (semver specifies that only public API matters), but it is respected in spirit (the breaking change is in supported build environments, which people do care about when picking versions), but it is also the smallest possible unit of change that still counts as a breaking change, so it’s a bit of a technicality as well.
Personally I’m quite satisfied with it, it takes a decent understanding of semver to produce a case this finely balanced on the edge of two technicalities, which gives me the impression of being playful with semver rather than disrespecting, or being unaware of, semver. YMMV
> It MAY also include minor and patch level changes.
I ultimately understand this as "I can release a patch as a major if I feel like it"
I understood that to mean you don’t have to break updates into their major, minor, and patch changes. Like if you’re at 7.88.2, you don’t have to put all your patches into update 7.88.3, then ten minutes later release 7.89.0 with your minor changes, and then ten minutes after that release 8.0.0 with just the major breaking changes. You can instead bundle them all as 8.0.0 because a major change can contain minor changes and patches, and besides it’s far more convenient to not have to break apart the update.
I do appreciate the logic of your understanding, that “breaking change therefore major version bump” does not imply “major version bump therefore breaking change”.
People get really hung up on what is, or isn't "technically" a change to the API. "This now breaks the build" is a change to the public API in the only sense that matters.
What?
> > We decided it was about time to reset the minor number down to more a manageable level and doing it exactly on curl’s 25th birthday made it extra fun. There is no API nor ABI break in this version.
Intentions-wise this has nothing to do with the Venerable SemVer.
printf "NICK gitbot42\nUSER foo bar baz\nPRIVMSG #gitevents :pull now\nQUIT :foobar\n" | nc irc.server.foo 6667Another potential use case for IRC is scripting a data collector to connect, run /list on a number of IRC networks, and disconnect. Eg, something similar to whatever netsplit.de does to collect its statistics.
But then, given the ability to connect to IRC via TELNET, perhaps Curl can already claim support for IRC.
I guess cURL could connect, with, send a message and leave, or list rooms, but that's already a hack on the original use case of IRC. And it's only a small fraction of what IRC is used for, namely people interacting with each other. "Supporting IRC" would mean at least that.
I love C as much as the next guy, hell, I even write it for fun when I'm feeling down -- but the one thing I won't do, beyond a little "i wrote an http 1.0 server in C" joke project, is networking.
Keep your C offline. If I do networking, it has to be modern C++ with static analyzers, good practices, boost asio, unit testing, and sanitizers, or just Rust, Erlang/Elixir, or whatever other non-C language.
Ive never seen a library get as abused and misused as Curl in source code - well maybe zlib. I think it's great that curl exists, and Im glad its so old that the bugs are mostly worked out, but writing a subset of curl that doesnt have a million issues in a weekend is not so unrealistic.
Edit: Just found this[0], hehe. :)
[0]: https://daniel.haxx.se/blog/2021/05/20/i-could-rewrite-curl/
https://daniel.haxx.se/blog/2021/05/20/i-could-rewrite-curl/
GET / HTTP/1.0
Host: example.com
over a socket and that's already mostly working. Figure out TLS. Then you just have to do command line parsing and add the stuff you parsed into your request.Is this sarcasm? A joke?
Between the docs[1][2] and the examples[3] I was up and running using my own IO stack in a couple of evenings. If I had used the IO stack from the library it would have been very easy.
Another couple of evenings and I had it integrated with Windows' certificate store. In the end it wasn't very difficult to implement, but it was a bit more of a challenge figuring out the documentation and how it related to mbedTLS.
Definitely a rewarding experience, gave me some nice insights into the plumbing.
edit: Note, not trying to argue replacing libcurl is a weekend project!
[1]: https://mbed-tls.readthedocs.io/projects/api/en/latest/
[2]: https://mbed-tls.readthedocs.io/projects/api/en/latest/api/g...
[3]: https://github.com/Mbed-TLS/mbedtls/blob/development/program...
Even with just http(s), what you describe is just a tiny fraction of typical use cases, even if you ignore all the rarely used bits.
Othwerise for basic HTTP version, I'll use Fetch API that has TLS already figured out. https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
writing stuff I use is not that much of an effort. However providing various configuration options, handling edge cases and scenarios millions of programmers would like to use... different league.