4 ms·
Plan 9 had such a powerful model for networked systems using these virtual file systems, it sounds like a fairytale! Oh, want to use that other machine as a ga
by black_knight 25d ago
Plan 9 had such a powerful model for networked systems using these virtual file systems, it sounds like a fairytale!
Oh, want to use that other machine as a gateway? Just mount its /net.
Oh, want to route audio through another machine? Just mount their soundcard into your /dev.
Oh, your machine is too puny to do the task at hand? Just run “cpu thebigmachine” which transplanted your entire environment over there (all the virtual file systems) so that you can continue doing what you were doing, but using that machine’s CPU and memory.
This solved the problem of having to transplant your setup to the remote machine, which you have with modern SSH. If you wanted a different environment you instead created it locally. Each process har its own virtual file tree with mounts.
There were cool things at the local level too: All the programs would expose virtual file systems to interact with. Text editor? Each window had a directory with files containing window content, current selection, even the UI “tagline” with commands. This meant you could write scripts for your programs in any language, because you just had to interact with files.
A modern take on plan 9 is definitely on my Christmas wishlist!
- mpweiher 25d agoHave a look at Objective-Smalltalk[1][2], with polymorphic identifiers[3] (all identifiers are URIs), storage combinators[4] (virtual filesystems on steroids), and polymorphic write streams[5] (streams everywhere). Objective-Smalltalk basically provides the sorts of things you write about locally at the language level. You could also move specific instances behind an operating system boundary. [1] https://objective.st https://objective.st [2] https://dl.acm.org/doi/10.1145/3689492.3690052 https://dl.acm.org/doi/10.1145/3689492.3690052 [3] https://dl.acm.org/doi/10.1145/2508168.2508169 https://dl.acm.org/doi/10.1145/2508168.2508169 [4] https://2019.splashcon.org/details/splash-2019-Onward-papers/7/Storage-Combinators https://2019.splashcon.org/details/splash-2019-Onward-papers... [5] https://dl.acm.org/doi/10.1145/3359619.3359748 https://dl.acm.org/doi/10.1145/3359619.3359748
- black_knight 25d agoCould you explain the connection you see a bit more? Part of the appeal of the Plan 9 approach was that you could use any program in your distributed environment, written in any language, because the abstraction layer was the file system – the lingua Franca of IO.
- mpweiher 24d agoSure! To start: An operating system is a collection of things that don’t fit into a language. There shouldn’t be one. — Dan Ingalls, https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk.html https://www.cs.virginia.edu/~evans/cs655/readings/smalltalk.... Let's start with an example, the Objective-Smalltalk equivalent of Python's simple web-server for a directory. Python: python3 -m http.server 8000 This serves the current directory on port 8000. The invocation for the Objective-Smalltalk script doing the equivalent job looks as follow: ./simplefileserver.st ./ 8000 Here is the Objective-Smalltalk 'simplefileserver.st' script: #!env st #-server: <ref>dir port: <int>port framework:ObjectiveHttpd load. dir asScheme waitOnPort: port. If you look carefully, you'll notice that this doesn't actually say anything about the filesystem. It just expects an argument 'dir' that is a 'ref' and then goes from there. Here are some other example of what a "ref" can be: ./simplefileserver.st https://objective.st 8000 ./simplefileserver.st sftp://otherhost.local 8000 ./simplefileserver.st env: 8000 ./simplefileserver.st defaults: 8000 ./simplefileserver.st class: 8000 ./simplefileserver.st scheme: 8000 The first will make this server act like an http proxy, the second will serve a remote directory, the third will serve our environment variables, the fourth will serve the contents of our process's defaults database (a macOS/iOS thing), the fifth our classes and the sixth the contents of the scheme registry where all the other schemes listed so far are registered. "Ref" is anything referencable by a polymorphic identifier, a slightly adapted version of a URI. And any ref can be turned into a store (aka "scheme-handler"). And a store can be literally anything that can store and retrieve data by key/index/name/path, from local variables via filesystems, databases all the way to the World Wide Web. So you can see that you can get the same location transparency that Plan 9 gives you without requiring operating system support. Which comes in handy when you can't switch to a new operating system. What's more, the support extends to a lot of things even Plan 9 probably wouldn't consider a filesystem (local variables?). Last not least, this does not require accessing everything via POSIX API and a byte-serialized representation. Definitely not "least"! You can access via a byte-serialized representation (as via the http server above) if you want, and you can even access via POSIX API (there is a generic fileserver that serves any of these stores / scheme handlers) if you really, really want. I am not at all sure why you would want that. And you can, of course, also access this via any language that can talk to C as the libraries that implement the functionality are written in portable Objective-C. Objective-Smalltalk just provides the proper linguistic support.
- duttish 25d agoOh wow, I didn't know it had things like that. Especially the CPU functionality is really interesting. I'm pondering similar problems and the current solutions just aren't good enough.
- akshitgaur2005 25d agoRedox seems to take inspiration from it and has all things exposed as schemes so /home/user is actually /scheme/file/home/user, etc.
- nosioptar 25d agoI'd love a Plan9 with a keyboard driven UI.