title: Web of Documents
url: http://blog.danieljanus.pl/2019/10/07/web-of-documents/
hash_url: 31652af3fd4757154c51aadcbe9ffb39

<p>In 1960, Ted Nelson envisioned a&nbsp;web of documents.</p><p>It was called <a href='https://en.wikipedia.org/wiki/Project_Xanadu'>Xanadu</a>. It was a&nbsp;grand, holistic vision: of documents that, once published, are available basically forever; of bidirectional links that could glue together not just documents, but parts thereof; of managing copyright and royalties. It was complex. And it never really came to&nbsp;fruition.</p><p>But thirty-one years later, another web of documents took off. A&nbsp;much more modest undertaking than Xanadu, with a&nbsp;simple markup language, simple protocol to&nbsp;retrieve the documents, unidirectional, ever-rotting links, and not much else. The World Wide Web. It was prototyped by one man in a&nbsp;few months. And then its popularity exploded.</p><p>As the WWW spread, it grew features. Soon, it was not enough for the documents to&nbsp;contain just text: support for images was added. People wanted to&nbsp;customize the look of the documents, so HTML gained presentational markup abilities, eventually obsoleted by CSS. It was not enough to&nbsp;be able to&nbsp;view the menu of your local pizza store – people wanted to&nbsp;actually order a&nbsp;pizza: the need for sessions yielded cookies and non-idempotent HTTP methods. And people wanted the pages to&nbsp;be interactive, so they became scriptable.</p><p>All these features were good. They helped the Web meet actual needs. But having them has a&nbsp;significant consequence, one that is seldom realized:</p><p>We&nbsp;don’t have a&nbsp;Web of Documents anymore.</p><p>Let me pause at this point. I’ve been using the word “document” intuitively and vaguely so far, so let’s try to&nbsp;pinpoint it. I&nbsp;don’t have a&nbsp;precise definition in mind, but I’ll share some examples. A&nbsp;book is a&nbsp;document, to&nbsp;me. So is a&nbsp;picture, an illustrated text, a&nbsp;scientific paper, a&nbsp;MP3 song, or a&nbsp;video. By contrast, a&nbsp;page that lets you play Tetris isn’t. The essence of this distinction seems to&nbsp;be that documents have well-defined <i>content</i> that does not change between viewings and does not depend on the state of the outside world. A&nbsp;document is stateless. It exists in and of itself; it is its own microcosm. It may be experienced interactively, but only insofar as it enables the experiencer to&nbsp;focus their attention on the part of their own choosing; the potential state of that interaction is external to&nbsp;the document, not part of itself.</p><p>Obviously, this is not very accurate: there are border cases. For example, does a&nbsp;film DVD with a&nbsp;menu qualify as a&nbsp;document? Or how about a&nbsp;choose-your-own-adventure book? Or a&nbsp;HTML page with links to&nbsp;other pages? On the surface, the latter does provide out-of-microcosm interactivity; but viewed from another angle, it is no different than putting a&nbsp;reference in a&nbsp;book. The browser just makes it very easy to&nbsp;go to&nbsp;a&nbsp;shelf and pick another book.</p><p>The distinction is there, and it’s important. And with it in mind, let me reiterate:</p><p><i>We&nbsp;don’t have a&nbsp;Web of Documents anymore.</i></p><p>These days, the WWW is mostly a&nbsp;<i>Web of Applications</i>. An application is a&nbsp;broader concept: it can display text or images, but also lets you interact not just with itself, but with the world at large. And that’s all well and good, as long as you consciously intend these interactions to&nbsp;happen.</p><p>A&nbsp;document is safe. A&nbsp;book is safe: it will not explode in your hands, it will not magically alter its contents tomorrow, and if it happens to&nbsp;be illegal to&nbsp;possess, it will not call the authorities to&nbsp;denounce you. You can implicitly trust a&nbsp;document by virtue of it being one. An application, not so much.</p><p>I&nbsp;don’t want to&nbsp;name names, but it’s all too easy these days to&nbsp;follow a&nbsp;link to&nbsp;a&nbsp;news site, expecting an article, only to&nbsp;be greeted with “You have read N articles this month, please register to&nbsp;continue”. Definitely an application-y thing to&nbsp;say, not a&nbsp;document-y one. Now, the purveyors of such sites typically have legitimate economic interest in doing so—but once you sign up, they are able to&nbsp;record your actions, link them with your identity and build your shadow profile. This way, we&nbsp;have applications actively <i>masquerading</i> as documents, when in reality they <i>do&nbsp;non-documenty things</i> without telling you.</p><p>Legislation such as the EU Cookie Law and the GDPR (insofar as it requires disclosure of data processing) tries to&nbsp;remedy this. But the more I&nbsp;think about it, the more sense it makes to&nbsp;me to&nbsp;attack the problem closer to&nbsp;its root: to&nbsp;decomplect the notions of a&nbsp;document and an application; to&nbsp;keep the Web of Applications as it is, and to&nbsp;recreate a&nbsp;Web of Documents—either parallel to&nbsp;it, or as its sub-web.</p><p>To&nbsp;do&nbsp;this, we&nbsp;need to&nbsp;take a&nbsp;step back. (Or do&nbsp;a&nbsp;clean start and invent a&nbsp;whole new technology, but this is unlikely to&nbsp;succeed). Fortunately, we&nbsp;don’t have to&nbsp;travel all the way back to&nbsp;1992, when the WWW was still a&nbsp;Web of Documents. (I&nbsp;still remember table-based layouts and spacer gifs, and the very memory makes me shudder). I&nbsp;think we&nbsp;can base the new Web of Documents on ol’ trusty HTTP (or, better, HTTPS), HTML and CSS as we&nbsp;know them today, with just three restraints:</p><ol><li><i>No methods other than GET</i> (and perhaps HEAD). POST, PUT, DELETE and friends just have no place in a&nbsp;world of documents. They are not idempotent; they potentially modify the state of the world, which documents should not be able to&nbsp;do. (I&nbsp;was also thinking “no forms”, but with #1 in place, it seems like an unnecessary refinement. After all, forms that translate to&nbsp;GET requests just facilitate creating URLs: a&nbsp;user could just as well have typed the resulting URL by hand.)</li><li><i>No scripts of any kind.</i> Not JavaScript, not WebAssembly. Not even to&nbsp;enrich a&nbsp;document, such as syntax-highlight the code snippets. This one may seem too stringent, but I&nbsp;think it’s better to&nbsp;err on the safe side, and it’s very easy to&nbsp;enforce.</li><li><i>No cookies.</i> Cookies by themselves aren’t interactive, but having them makes it all too easy to&nbsp;abuse the semantics of HTTP to&nbsp;recreate sessions, and on top of them reinvent the app-wheel and eventually forfeit the Web of Documents again.</li></ol><p>Again, there may be corner cases that may have escaped me. But if a&nbsp;WWW page conforms to&nbsp;these restrictions, I&nbsp;think it may be pretty safe to&nbsp;call it a&nbsp;“document” and make it a&nbsp;part of the Web of Documents.</p><p>How do&nbsp;we&nbsp;achieve this? I&nbsp;don’t know, really. I&nbsp;don’t have a&nbsp;concrete proposal. Perhaps we&nbsp;could have dedicated browsers for the WoD; perhaps we&nbsp;could make existing browsers prominently advertise to&nbsp;the user whether they are browsing a&nbsp;document or an application. On top of all the technical decisions to&nbsp;make, there’ll be significant campaigning and lobbying needed if the idea is ever to&nbsp;take off.</p><p>I&nbsp;don’t dare dream that it ever will. My intent in this article is to&nbsp;provide food for thought. All I&nbsp;ask from you, my reader, is consideration and attention. And if you got this far, chances are I&nbsp;got them. I’m grateful.</p><p>This page is a&nbsp;document. Thank you for reading it.</p>
