You have managed simultaneously to radically underestimate the complexity of Node and Express's HTTP handling, while at the same time radically overestimating the complexity of what miekg/dns is being asked to do here.
The majority of the 20,000 lines of non-test code in miekg/dns are just handlers for record types the author of this article didn't need; much of the rest of it is stuff like zone file parsing and DNSSEC signatures, which again have nothing to do with what the author wrote.
What you conspicuously won't find in miekg/dns: a recursive lookup routine.
Re:A toy DNS resolver
by charcircuit on Wednesday February 02, 2022 @12:10AM
(#30173980)
>What you conspicuously won't find in miekg/dns: a recursive lookup routine.
Sure, but it implements the building blocks that you need to create one. Those building blocks are going to be where a good chunk of code is going to be. (Yes, there is a lot of code from that library that will be unused)
No it's more akin about him saying he made a pizza, but all that was done was import a pizza and then sprinkle some pepperoni on it.
Imagine if I said I made an HTTP server in 6 lines.
I think it would be reasonable for people to say that I didn't make a HTTP server in 6 lines.Just how I used a library to make a HTTP server me and I handled requests/responses, the author of this article used a library to handle DNS requests/responses. The 80 lines figure for making a DNS resolver is misleading when there are 26k lines of Go code (according to cloc) for handling DNS that are just in a library instead of the main file.