It’s just the title that’s a bit simplified. First paragraph already says:
“This tutorial is meant as an introduction to libdill socket library. We are going to develop a simple version of wget utility, that can be used to download webpages from the net.”
It's all abstractions and sometimes concretions. Then there's leaky abstractions where you need to know details of the implementation in order to use it.
Actually one could go without that library and code would not be that much bigger. To me it seems it provides an easier way to open secure pages through TLS, but if all one needs is sockets communicating each other, then the usual network libraries are more than enough. Ages ago I've written C network code under Linux that compiled and run under Windows just by changing a couple lines. Not sure if that would be doable today though: at that time Microsoft was forced to include a POSIX compatibility layer, and Winsock itself was not that far from the classic UNIX implementation.
libdill looks interesting, but I'm a bit surprised by the lack of prefix in the functions, types, etc. C does not have namespaces, but open source libraries usually use short prefixes for readability. What do you think ?
libdill is about concurrency made easy (according to the home page). But this tutorial has no concurrency as far as I can see after a quick read. That's a bit weird way introducing a library.
22 comments
[ 3.3 ms ] story [ 58.0 ms ] threadThis isn't "Wget in 50 lines of C code", just `wget --help` page is 192 lines.
“This tutorial is meant as an introduction to libdill socket library. We are going to develop a simple version of wget utility, that can be used to download webpages from the net.”
It's like claiming you "rewrote Quake in 2 lines" then posting a .bat file with the contents "echo Starting quake lol...\r\nquake.exe"
https://play.golang.org/p/vXTpR9IjBxV
How about 'Tutorial: HTTP Client in C with libdill'?