Linux Namespaces Are a Poor Man's Plan 9 Namespaces
The Plan 9 design wasn&#x27;t as great as people like to think and it wouldn&#x27;t have survived in the advertised form if Plan 9 actually had taken off. Actually it was already losing that aesthetic coherence quite early on in its lifetime.<p>Hierarchical nouns, a fixed collection of verbs and a stream of bytes is aesthetically pleasing and can be helpful for developers hacking around, but is too limited and low level a vocabulary to express many important APIs. An obvious example is the Plan 9 windowing&#x2F;graphics server, which in theory is just files but because that&#x27;s way too low level is actually accessed via a client library written in C. That&#x27;s how it would have always gone in the end: in theory it&#x27;d be files, in practice it&#x27;d be RPCs squashed and squeezed to look a bit like files as long as you don&#x27;t think too hard, with a C API wrapping it for convenience.<p>APIs and files are very different things. Every modern platform has a fairly sophisticated inter-process RPC system at its core for that reason. Windows has (D)COM, Apple has XPC, Linux has DBUS (but doesn&#x27;t use it as much), Android has the Binder, Chrome(OS) has Mojo. The designers of these platforms were all quite familiar with Plan 9 and yet none chose to implement the everything-is-a-file model, which I think is good evidence that this is a dead-end design wise. Fundamentally you don&#x27;t write complex programs in shell scripts but the Plan 9 design assumes you do.<p>One place this model does live on is HTTP, but HTTP isn&#x27;t enough and is thus always used with extensions, at minimum JSON or XML but also things like multipart, websockets, headers, CORS, maybe Swagger etc. And of course HTTP servers only look like a file system on the surface, in reality you can&#x27;t actually browse them or do most of the things you&#x27;d expect of a filing system, and you don&#x27;t use the filing system APIs to access them.<p>Networking and filesystems are an especially difficult combination because the UNIX APIs for file access (which Plan 9 largely also uses) are too impoverished to provide necessary  functionality. They all assume relatively reliable and low latency access, so even quite basic things like being able to get progress information from operations isn&#x27;t easy.<p>Still, the underlying ideas in Plan 9 are worth iterating on. My company has an internal Kotlin based scripting tool designed to bridge the world of shell scripting and &#x27;real&#x27; programming languages. It exposes a shell-like API with functions like mv, cp, wget, and so on which are all implemented internally. One of the things it does is expose progress events via a unified progress reporting API. You can assign a progress event handler and then do things like file copies or archival operations, and get information on what&#x27;s going on. By default it renders a nice animated progress bar on the terminal but you can also do things like serialize these events across network boundaries. The filesystem API is pluggable so you can do things like browse into zips, and there&#x27;s also an ssh function that lets you connect to the file system of a remote server: strings can be turned into path objects that remember their home filesystem and those can then be used to do things like copy&#x2F;browse&#x2F;execute things on remote systems:<p><pre><code>     val local = dir &#x2F; &quot;local-archive.tar.gz&quot;
     ssh(&quot;&#x2F;&#x2F;foo.com&#x2F;home&#x2F;bar&quot;) {
         cp(&quot;remote-archive.tar.gz&quot;, local)
     }
     extract(local)
     </code></pre>
... etc ...<p>It also acts as a sort of testbed for vaguely Plan9-ish ideas. For instance I want to experiment with how to adapt a regular POSIX-ish file API to allow nodes to be both files and directories simultaneously. But you don&#x27;t need an OS for this. It can all be done in userspace.