Summary

  • RFC 1436, March 1993, describes a protocol "designed primarily to act as a distributed document delivery system" whose clients show "a hierarchy of items and directories much like a file system".
  • The client "decides what items are available by looking at the first character of each line in a directory listing", and "augmenting this list can extend the protocol".
  • That list is the design: 0 is a file, 1 a directory, 2 a phone-book server, 3 an error, 7 an index-search server, 8 a telnet session, 9 a binary file.
  • The table had no owner, no version and no rule for values it did not contain — the failure mode every enum meets eventually.

The menu is the API

Gopher had no document format and no markup. A client asked for a selector; the server answered with lines. Each line was an item: a type character, a display string, a selector, a host, a port.

Everything the client could do came from that first character. There was no negotiation, no content-type header, no way to send a preference and a fallback in the same breath. The client did not fetch an item and then work out what it was. It read the menu and knew before a single byte of the item arrived.

That is the elegance people forget. One menu could mix a text file, a binary, a search service and a Telnet login, and the client knew which door to open for each. The type was not in the payload. It was in the index, one byte wide, in front of the user.

One character is cheap and decisive

The economics are visible in the specification itself. Because the type is positional and one character wide, a client is an afternoon's work and a server is a weekend's. That is not a small achievement: it is why Gopher went from a Minnesota campus project in 1991 to a global menu of servers in under two years.

But cheapness is a loan against the future. One character buys 256 kinds and no way to say what a kind means. The meaning lives in a table, the table lives in the client, and the client lives in the user's hands, where it is always older than the server.

Extension by inventing letters

New capabilities arrived as new characters: g for GIF, h for HTML, i for informational text, s for sound, T for TN3270. The protocol grew by adding rows to a table, which is the cheapest form of extensibility there is.

It is also the most fragile. A row in a table is not a feature. A type is only useful if the client has code for it, so adding a row does nothing on its own: the client already in the user's hands must be updated too, and it will not be. The RFC's confidence — "augmenting this list can extend the protocol" — is true in the narrow sense that the list can grow. It is false in the sense that anything happens when it does.

Where it broke

Gopher's obituary usually cites the University of Minnesota's 1993 licensing scare and the web's better sales pitch. Both are true. Neither is the interesting part.

The interesting part is smaller and more reusable. An unknown type character leaves a client with three choices: guess from the filename, ask the user, or fail. All three are what a protocol does when its type system is a list everyone extends and nobody owns.

The failure was not that the table was small. It was that the table had no version, no maintainer and no defined behaviour for a value it did not contain. A client meeting a character nobody had defined had nothing to consult, and no way to say which table it was running.

The web's answer looked like a detail and was not: send the media type with the response, and let the receiver decide what it can display. The decision moved out of the sender's catalogue and into the payload, and out of a shared table and into a local one. A browser that meets a media type it cannot render offers a download. A Gopher client that meets a letter it has never seen is simply stuck.

What the model got right

The typed menu survived in other clothes: a search result page, an index of endpoints, a link with a declared relation, a media type in a header. What died was the assumption that client and server share one table of kinds.

That assumption holds inside an organisation, where one hand updates both ends. It fails between strangers, which is the boundary the internet crosses every day.

The lesson about type systems

A type system with no owner is a vocabulary, and a vocabulary only works while everyone updates at the same speed. The internet has never updated at one speed.

The general lesson is now a design discipline: minimum initial specification, localized future decision, voluntary adoption. When you put meaning in a small token, decide who maintains the table of tokens, say what a reader should do with one it does not know, and let the reader declare which table it is running. Unknown values arrive before the first release, not after.

Gopher's type character was not a bad idea. It was a good idea with no owner, no version and no exit. A one-byte design that strangers cannot extend is a design that has already picked its replacement.