Reaching the Unix philosophy's logical extreme with WebAssembly
The pipeline pattern has its uses, but it&#x27;s not the most important (or even the most well known?) tenant of the Unix philosophy.<p>It&#x27;s &quot;Everything is a File&quot;[0].  That one has really stood the test of time.
And it&#x27;s often misunderstood to mean that everything implements {Read,Write,Seek,Truncate, etc.}.  Then when a TCP socket or character device or whatever shows up, the whole abstraction leaks, and it seems like not everything is a file.<p>The Good Parts of Everything is a File:<p>1. Everything exists in a Filesystem, meaning a directory tree.  There are directories, they list things, either resources, or more directories.  A process gets access to all additional resources through the filesystem.  We&#x27;ve really screwed up by putting networking in it&#x27;s own place, environment variables, etc.<p>2. File descriptors.  If you squint, these are capabilities[1], which is probably the best way to manage resource permissions.  They are fine grained, they handle delegation, there is a tree of legitimacy back to the root.  We were so close, but we got this one wrong too, with a single global root, instead of a chroot per process by default.<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Everything_is_a_file" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Everything_is_a_file</a><p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Capability-based_security" rel="nofollow noreferrer">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Capability-based_security</a>