4 ms·
And yet almost anyone can implement an HTTP server with their own parser, that works for every client out there in just a few weeks, but not TCP stack or DNS se
by userbinator 11y ago
And yet almost anyone can implement an HTTP server with their own parser, that works for every client out there in just a few weeks, but not TCP stack or DNS server.
That has little to do with binary vs. text. It's because [1] TCP is itself a very complex protocol, especially to get all the corner cases right, and [2] DNS servers are not popular to write because there is usually very little reason to. If HTTP was a simple binary protocol you'd probably make the same observation.
- zzzcpan 11y agoI think it has everything to do with it. Because text protocols share a single textual encoding with lots of tools available and usually don't force you to parse anything you don't need. Put a few rules in your parser generator and you are done. Binary protocols, on the other hand, each use their own encoding and usually force you to decode every little thing before they can be used correctly. Which always makes them much more complicated and error-prone, than textual protocols.
- andrewflnr 11y agoText protocols "each use their own encoding" in exactly the same way as binary ones. The only difference you've really mentioned is that tools for handling them aren't as mature. There's also a difference in design, but I suspect that's because binary protocols are used in places where the complexity pays for itself, and anything else, including a text format, would be too fat.