6 ms·
I've read a lot of places that say "Plan 9 is basically a better Unix", but I'm not entirely sure why. Can someone explain what made Plan-9 special? I'm not a
by tombert 9y ago
I've read a lot of places that say "Plan 9 is basically a better Unix", but I'm not entirely sure why. Can someone explain what made Plan-9 special? I'm not asking in a passive aggressive sense, I genuinely want to know.
- butterisgood 9y agoEverything is a file system. You can mount almost all things. All things have private namespaces by default. Right down to the TCP/IP stack... you can run a program called "sshnet" and connect to a remote unix box, the /net in that process' namespace now has a tunnel to the remote box, and all children of that process that opt-in to share the namespace now have a VPN-like to the network you just ssh'd to. Because the network stack is a file system you can do basic open, read, write, close stuff to dial up remote services and work with them. As such there's IRC clients written in the shell, without evil extensions like /dev/tcp in bash. It's fun, but it doesn't outrun any other OS I've seen. Maybe that's changed.
- Asooka 9y agoHonest question: If we extend dbus to be similarly pervasive in Linux (via BUS1 or whatever ends up being merged), won't it have pretty much the same benefits? Once it's in-kernel I'm 100% sure we'll end up with a virtual file system for accessing it. It will definitely never be quite as elegant and integrated in the system as Plan9, but maybe we could reap similar benefits?
- butterisgood 9y agoWell the nice thing, maybe, about Plan 9's virtualization of resources is that they all follow some 9P variant (simple protocol). 9p is v9fs in linux. There's FUSE 9p stuff for other platforms. There's a virtualized Erlang runtime that sits directly on Xen as the OS that uses 9p. 9p is part of QEMU's way of talking to the guest (or is it the host?) OS. It's been on a lego mindstorm brick too. To me, kernel dbus is a bit more like mach_ports. Those have their own advantages too. As did Solaris Doors.
- shimon_e 9y agoLinux is no longer pure Unix. Linux has adopted parts of plan 9.
- ori_b 9y ago> If we extend dbus to be similarly pervasive in Linux That kind of pervasiveness involve replacing all i/o through the entire system with dbus. File systems, netlink, sun rpc, mmap, signals and kill, tcp, and so on. And then making dbus sanely deal with networking and authentication. 9p isn't just pervasive: it's the only way to talk to the system, which means that if you want to mess with namespacing things, all you need to think about is 9p.
- qubex 9y agoIn Plan9 UNIX's ”everything is a file” philosophy is reaffirmed in a heightened and enhanced form, and all resources (CPUs, even) on a distributed network can be mounted with a simple protocol and accessed remotely. These namespaces make it possible to provide each and every program with its own namespace (to the point of being able to run a copy of the window manager within itself). For example you have /net directories with all the TCP ports in /net/tcp and those can be concatenated to forward ports or even create routers. It's amazing.
- jacquesm 9y agoIn a nutshell, and somewhat simplified: it cleans up the /dev/ interface and turns everything into streams of characters and mounts. So rather than a bunch of messy ioctls and other out-of-band mechanisms it just works with streams. This is nice because it allows you to use remote resources as if they're local. Distributed name spaces, distributed computing, compute servers, distributed file servers and so on. Remember the SUN slogan 'the network is the computer'? Plan 9 makes that a reality.
- f2f 9y agoI think ESR summarized it very well for the layman almost 20 years ago in "the art of unix programming": http://catb.org/~esr/writings/taoup/html/plan9.html http://catb.org/~esr/writings/taoup/html/plan9.html
- m_sahaf 9y agoI've played with Pla9 a bit and I find it overall interesting. Here are the things from the top of my head that are improvements over Unix: - Truly everything is a file. No exceptions; no special cases. - Symlinks do not feel like a hack causing trouble. If you need a reference to a directory in another path, you mount it. If your software writes its binaries into its custom directory and you want the binaries within the $PATH, you mount that custom directory into /bin (or so, from what I remember). - Namespace isolation for processes. - Distributed file system
- pjmlp 9y ago> Truly everything is a file. No exceptions; no special cases. As graphics fan, I wonder how this would work out with modern GPU driver layers.
- butterisgood 9y agoJohn Carmack used to participate in the Plan 9 mailing lists https://marc.info/?a=111558719100068&r=1&w=4 https://marc.info/?a=111558719100068&r=1&w=4 Though Rob Pike might have not been very cooperative or enthusiastic https://marc.info/?l=9fans&m=111558699517143&w=4 https://marc.info/?l=9fans&m=111558699517143&w=4 He goes on about some interesting architectural advantages already in Plan 9 from a graphics programming standpoint and capitalizing on them someday. It'd be interesting to hear about how far along he got. https://marc.info/?l=9fans&m=111558698816997&w=4 https://marc.info/?l=9fans&m=111558698816997&w=4 Here he talks about trying to hack Plan 9 to run Quake https://marc.info/?l=9fans&m=111558698416915&w=4 https://marc.info/?l=9fans&m=111558698416915&w=4
- pjmlp 9y agoInteresting read, including some QNX and Amiga related stuff, thanks.
- naasking 9y ago> - Namespace isolation for processes. This is seriously underappreciated IMO. You can entirely replace access control with private namespaces without any real loss in generality. In fact, they're more flexible and secure.
- pfranz 9y agoIt's probably more accurate to say it was intended to be the successor of UNIX. Plan 9 was developed by the same group that developed UNIX (Bell Labs) with many of the same prominent people credited with C and UNIX; Rob Pike, Ken Thompson, Dennis Ritchie. https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs
- fusiongyro 9y agoPlan 9 shows that you can reduce the complexity of Unix by changing the idea behind mount slightly (mounts are inherited by processes rather than global) and creating a simple network filesystem protocol that applications can use to expose their state through. In Unix you often get stuck having to create these walled-off systems. Your editor's inner state, for instance, is not visible to other applications, so you need to come up with your own whole programming scheme. Same with your window manager. And all your networking happens through a separate set of APIs that are similar to the file descriptor APIs but different enough that nothing works transparently. Once you have per-process mounts and a simple network filesystem, all your applications and devices can start exposing their state over that protocol. All your software and hardware are automatically networkable if you follow the design. And you can use Unix utilities to do things that previously would require whole subsystems to be built. You don't need to build your own programming language for Acme, because Acme's state is visible as a filesystem. Same with the window manager. And you don't need to build a custom networking scheme for sharing Acme with your friend on another machine, because you can export Acme's filesystem to that machine (or have your friend export their keyboard onto your machine as a child of the Acme process). "Everything really is a file" is a good way to sum it up. But that's only possible and relatively safe because of 9P and per-process namespaces.
- gigatexal 9y agothat sounds really simple and powerful. i am keen to start following this project. Is there a patreon or a donation portal to help fund development?
- qubex 9y agoThis isn't really a ’project’ in the sense you seem to intend: it was a 1990s AT&T research project that was abandoned and released under an open source licence in the mid-2000s.
- gigatexal 9y agoBum deal. There seems to be some interest at least here on HN, perhaps someone or a group of someones could pick it up and bring it to bear for 2017+?
- dflock 9y agoIt's a truly distributed operating system and it's unix taken to it's logical conclusion. Everything is a file and everything is network transparent, thanks to 9P. The first wikipedia article is very worthwhile reading - this is a little except that gives you the idea: > "Unix allows file systems to be built up from disparate resources using concepts such as links and file system mounts. These features masked the original directory; if one mounts a new filesystem on the directory named "net", one can no longer access its previous contents until the operation is reversed. > Plan 9 introduced the idea of union directories, directories that combine resources across different media or across a network, binding transparently to other directories. For example, another computer's /bin (applications) directory can be bound to one's own, and then this directory will hold both local and remote applications and the user can access both transparently. > Using the same system, under Plan 9 external devices and resources can be bound to /dev, allowing any device to be shared over the network without any additional code." So, you can union mount other machines /dev/cpu/ folders into your machine's /dev/cpu folder and then have access to all the CPU's. Same for all other hardware, software and storage. Just these two things - Union Mounts and 9P - when built into the whole system, create a very dynamic distributed computing environment. I really, really wish more of this would make it into Linux. We've kinda got some of it, but without joining up all the other bits, the real power isn't quite there. More: http://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs http://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs http://plan9.bell-labs.com/plan9/ http://plan9.bell-labs.com/plan9/ http://en.wikipedia.org/wiki/9P2000 http://en.wikipedia.org/wiki/9P2000 http://en.wikipedia.org/wiki/V9fs http://en.wikipedia.org/wiki/V9fs http://en.wikipedia.org/wiki/List_of_distributed_computing_projects http://en.wikipedia.org/wiki/List_of_distributed_computing_p... http://en.wikipedia.org/wiki/Inferno_\(operating_system\) http://en.wikipedia.org/wiki/Inferno_\(operating_system\) http://doc.cat-v.org/plan_9/4th_edition/papers/plumb http://doc.cat-v.org/plan_9/4th_edition/papers/plumb http://swtch.com/plan9port/ http://swtch.com/plan9port/
- pmoriarty 9y ago"Just these two things - Union Mounts and 9P - when built into the whole system, create a very dynamic distributed computing environment. I really, really wish more of this would make it into Linux." Union mounts and 9P are already available in Linux.[1][2] What other things would you like to see? [1] - https://lwn.net/Articles/325369/ https://lwn.net/Articles/325369/ [2] - https://www.mjmwired.net/kernel/Documentation/filesystems/9p.txt https://www.mjmwired.net/kernel/Documentation/filesystems/9p...
- pjmlp 9y agoSomehow many Plan 9 fans seem to forget that the design continued as Inferno. So with that in mind, I would rephrase that as "Inferno is basically a better Unix". You can learn more about it, including the programming manual with lots of Limbo examples at: http://doc.cat-v.org/inferno/4th_edition/ http://doc.cat-v.org/inferno/4th_edition/ You can easily see some of Go's pedigree on Limbo's design. Nowadays Inferno is still being sold by Vita Nuova, the company that acquired the rights after Bell Labs folded the project. http://www.vitanuova.com/inferno/ http://www.vitanuova.com/inferno/
- butterisgood 9y agoGo and Limbo have newsqueak as an ancestor. https://en.wikipedia.org/wiki/Newsqueak https://en.wikipedia.org/wiki/Newsqueak Alef was pretty neat too and was also on Plan 9 https://en.wikipedia.org/wiki/Alef_(programming_language) https://en.wikipedia.org/wiki/Alef_(programming_language)
- bitwize 9y agoIn Plan 9, everything literally is a file. Processes communicate using the 9p protocol which is also the basis of the file system; each process also has its own, local view of the file tree which children can inherit (or not). To do IPC with a server process, simply mount it and begin reading and writing to files in the mounted directory. Oh, and 9p is network-transparent, so you can see remote files and processes as if they were local. It really is a neat idea, and shows what can be done when you take an idea to its logical extreme. But the interface is not human friendly. Real-world workloads are complicated and require kernels that handle the weird edge cases so you can't reduce a production kernel to a simple idea. And 9p performance lags behind other networked file systems. So it's really more of a prototype and a laboratory for generating ideas to be used in other systems, rather than a replacement for production Unix.