This repository has been archived on 2017-04-03. You can view files and clone it, but cannot push or open issues/pull-requests.
blog_post_tests/20110819184646.blog

14 lines
5.0 KiB
Plaintext

GPSD 3.0 finally ships. It’s been a long epic.
<p>Protocol transitions are hard.</p>
<p>Yeah, I know the experienced software developers reading that are thinking &#8220;Well, <em>duh!</em>&#8220;. Shut up already, I&#8217;m venting here. I&#8217;ve just spent the better part of two years &#8211; actually, if you include design time and false starts it could be closer to five years &#8211; designing a new application protocol for my gpsd service daemon, implementing it, getting it deployed, dealing with problems and course-correcting.</p>
<p>For those of you in the cheap seats, an &#8220;application protocol&#8221; is a kind of language that a program uses to communicate with other programs. Normally humans never see these, but there&#8217;s one big example that non-geeks have often seen bits of. HTML, the Web&#8217;s markup language, is an application protocol. Designing these is not easy. There are difficult issues and tradeoffs around flexibility, economy, expressiveness, and extensibility for uses we haven&#8217;t imagined yet.</p>
<p>When you have a whole bunch of programs written by different people communicating with a particular application protocol, changing that entire ecology to use a different one is not easy. A good analogy in the physical world is the difficulty of changing an entire country&#8217;s railroad gauge. The long-term benefits may be huge, but the short-term cost in capital and service disruption is daunting.</p>
<p><span id="more-3617"></span></p>
<p>Sometimes it has to be done, though. The old GPSD protocol wasn&#8217;t extensible enough, and it had some bad design decisions baked into it. Hackers can read a more detailed discussion of the technical issues in my white paper <a href="http://gpsd.berlios.de/protocol-evolution.html">GPSD-NG: A Case Study in Application Protocol Evolution</a>.</p>
<p>It took me three years of thinking and experimenting to get to the point where I had a new protocol design I was happy with. Took me nearly two years after that to implement it, debug it, get it deployed, figure out where I&#8217;d made some minor design errors, and fix those. Did I mention that this sort of thing is not easy? Five years may seem like a long time, but all too many attempts at major protocol transitions fail in messy and expensive ways. </p>
<p>Mine didn&#8217;t because I did a simple thing. I wrote libraries to handle the client side of the protocol handling, and I told all of GPSD&#8217;s client developers &#8220;Use these! Because if you write or keep your own protocol parser, it&#8217;s going to break.&#8221; Then I changed the libraries so they could handle either old or new protocol. The theory was that once my client developers linked in a library version that swung both ways, they wouldn&#8217;t have to care when the actual protocol transition happened.</p>
<p>That was the theory, anyway. It didn&#8217;t work perfectly, because I didn&#8217;t get the library interface design quite right the first time. Or the second. I got the interface right on about the third try, and the structure format right on the fifth. I had a few client developers yell at me, not without justification, about library transition issues. About which I can only say &#8220;Sorry. My fault.&#8221; The thing is, it could have gone much, much worse &#8211; and it usually does. Comparatively speaking I&#8217;m actually <em>really good</em> at this &#8211; most end-users never saw a service disruption.</p>
<p>What all this effort bought us, functionally, is that handling new navigation sensors in GPSD and its clients is now pretty easy. The immediate gain is support for the Marine AIS system &#8211; and if you&#8217;re wondering about the real-world impact of that, GPSD had a role in the remediation of the Deepwater Horizon disaster. We&#8217;ll probably do aircraft transponders next. Gradually GPSD is becoming the handler for every kind of sensor that tells a computer where it is and where all the GPS-equipped ships and planes around it are. In the not very distant future GPSD is likely to handle communications from GPS-equipped automobiles, too.</p>
<p>With 3.0, we reach the point where I expect GPSD&#8217;s protocol and the library interface to be long-term stable. There are still a few client applications that haven&#8217;t caught up &#8211; notably Firefox, which last I heard was still using a roll-your-own parser rather than my C client library. But there&#8217;s only so much I can do, really; on the whole, the transition has gone as well as could have been expected.</p>
<p>Most of the people who rely on GPSD will never know it&#8217;s there. It&#8217;s not a user-facing application that people actually see, it&#8217;s plumbing that the programs they do see relies on. Like physical plumbing, it&#8217;s unglamorous and out of sight and essential. I&#8217;m OK with that. There&#8217;s a quiet kind of satisfaction &#8211; not really new to me, since some of my other code is even more ubiquitous &#8211; to knowing that the world rests on your software, even if most people will never understand how.</p>