Hacker News new | ask | show | jobs
by jeffreyrogers 4227 days ago
My understanding of Plan 9 is that the primary benefits it brought are in its ability to make a large collection of computers look like one unified system. So rather than asking what would it look like if Android was based on Plan 9, I'd think of it as: what would it look like if my laptop, TV, and smartphone all ran Plan 9.

I think then you'd have a scenario in which, for example, you can pick up your phone and tell your TV to start streaming some file you have on your laptop. You can probably do this now using some collection of complicated programs that you have to install, but with Plan 9 it would be easy since everything appeared to be just one part of a larger computing system.

Or another example: you're working at your office with a desktop computer running Plan 9. Then you leave the office for the night, but want to finish something at home, so you open up your laptop and have access to all your work files as if they are stored locally on your laptop. You just edit them in place and the copy at work is automatically updated as you go.

So that's how things would be different I think. Not revolutionary, but definitely an improvement on what we have now. (Note: I'm not a Plan 9 expert and have never actually used it, however, I do find the ideas from it interesting and have read a bit about it, so I think the above is fairly accurate).

3 comments

> Then you leave the office for the night, but want to finish something at home, so you open up your laptop and have access to all your work files as if they are stored locally on your laptop. You just edit them in place and the copy at work is automatically updated as you go.

I do this all the time, Gnome file manager (Nautilus) mounts my work computer over sftp with three mouse clicks (Connect to Server / select server / Connect).

Granted, I can only work on the remote files in Nautilus, and with GUI programs than I launch by right-clicking on the files in Nautilus. If I want a command line, I need to do some other, but also simple, tricks.

Plan 9 goes far beyond than that. Everything can be shared automatically, because everything is a file. Here are some scenarios that should be possible:

- You can access files remotely automatically from any application (akin to what sshfs does)

- You can access non-files remotely automatically: a printer is just a fd you write to

- A GPU from a distant cluster is just a resource you can use as if it were local (I'm speaking of implementation, not performance).

- A mail service can be accessed on a mail server, which is itself not connected to the wild internet but goes through a firewall... itself accessible through the same file protocol. Oh and the mail you want to send sits in your outbox on your phone, so you just grab it from your computer.

- You can play the music that lives on your machine on the speakers anywhere in your house by communicating with the remote fd

- One of the dream of Rob Pike (co-inventor) is that you wouldn't need a multi-core machine in your pocket for your mobile lives, you'd only need a good connection so you can access all resources on any server that is connected to the network. Your "smartphone" would then just be a terminal to pilot all your resources.

All of this accessible with the same interface, available in the OS. It may be have been a ludicrous dream, especially when we look at how much data would have been shuffling between machines, but the prospect of such networking still sounds awesome.

IO devices were also mounted/manipulable within this filesystem. So you could mount your home keyboard/mouse/monitor to your remote workstation (maybe an HPC box in some datacenter) and continue working where you left off. Java tried something similar with Jini but without the powerful abstract of everything being a file descriptor in some hierarchical mapping.
So, could we imagine a startup making Internet of Things, and smart homes, and basing their tech on Plan 9 instead of Linux?
At this point I'm not sure it's worth it. We've got far more covered by just using a working Linux and taping specific protocols together than trying to make Plan 9 even work everywhere (If we're talking IoT, we're talking exotic hardware, so there's much much more chance Linux will need less work to be adapted, if not already done)

On top of that, we already have some platforms to use on Linux: the Erlang VM already has a notion of "global cluster of things" where the actual location of a resource doesn't have an impact on how things are executed (other than performance). The plan9 utilities are also partly ported to run on Linux; maybe we could try to run services that speak 9p/9p2000/styx on top of Linux ? That would be more useful.

Sure. Sign me up. Also, ContikiOS.
it is absolutely not a ludacris dream. I've been dreaming it for years. All my machines run linux. As long as I'm NOT on a phone or tablet, I sign in, ssh, restore tmux/screen session, and pull X via xpra.

Why my phone is unable to be a terminal to all my other machines is beyond me.

I should have 1 hard drive and 1 "computer", and 1 desktop. Every other machine should be a window to this desktop.

At least... in my dream world.

I mean no disrespect but sampo's comment illustrates the problem plan 9 and any other advance has. "I can already do that, but" beats unification and concept so easily. You cannot just build a better, simpler foundation, you absolutely must demonstrate something new or dress it up with "chrome". We don't care about the better mousetrap. I can put together a clunkier solution that does what your new concept does is almost a point of pride. We all do it, and I wonder how it affects are advances.
I disagree. Optimizing for doing something better than the previous solution is always a viable solution, and it will drive customers.

Though, momentum is unfortunately the largest mover of sales and vendor lock-in. Plan 9 never built that momentum.

* Create an NFS mount to a directory holding thousands of images. Create another NFS mount with directories and subdirectories holding many files of any type.

* Open Nautilus

* Go to Edit -> Preferences. Click on the Preview tab

* Set Show Thumbnails to "Local Files Only" and "Count Number of Items" to "Local Files Only"

Then click on the NFS mounted directory in Nautilus.

You will not have any fun.

This bug has been sitting in the Nautilus bug tracker for over three years.

A fix would not be rocket science, just rewording what it says in the Preview tab would be a fix. Three years gone by and they can't even reword it. Which is fine, but it doesn't say much for the file manager and its inter-OS operability.

You would probably be better served by writing a 2 lines bash script to call sshfs and have it mounted through fuse. I don't see a point in going through GIO monstrosity for this.
That all sounds neat, but how does it work on less than ideal networks? The non trivial jitter and latency would mess up programs that assume things are local. Even things like buffering audio needs to be network aware. If local, low latency can be achieved. If remote, then buffer to avoid skips.

I'm a bit suspicious of things that make network access transparent.

I think the thing people tend to miss in looking at plan9 is that, it being true that the infrastructure it provided doesn't explicitly solve all these last-mile problems people have with network transparency, it does solve several major problems you come to before you can even reason about that. Having a uniform network protocol, a reasonable multi-node security model, and a workable method of uniformly addressing remote resources are the horse, what you do with it is the cart.
Certainly horrible if we were to switch to it now, but if it had caught on, maybe we would have put more money on improving networks instead of improving CPUs.

OTOH, Plan 9 was designed as a company-global "machine": you have a room filled with CPU clusters and storage clusters, and your own simple, stupid terminal to manage your resources. But your terminal is only a view; ultimately the data lives in the storage cluster and is processed in the CPU cluster.

Take a look at this page, notably the figure 1:

http://doc.cat-v.org/plan_9/1st_edition/designing_plan_9

As you can see, CPU and storage were expected to live on a high-speed, low-latency link because most of the data would fly between those two. Your terminal was expected to be anywhere else, possibly on the other end of a slow ethernet cable, and would coordinate the transmission of data from there. But most of the transmission would be between CPUs and storage. It wasn't supposed to be a truly p2p decentralized model.

QnX does all this and more and it works quite well. NFS is just a particularly botched implementation of an attempt at network transparency.
Yup, as anyone who has ever run a program that accesses files over NFS knows it all sounds very wonderful on paper and absolutely sucks in real life.
> Or another example: you're working at your office with a desktop computer running Plan 9. Then you leave the office for the night, but want to finish something at home, so you open up your laptop and have access to all your work files as if they are stored locally on your laptop. You just edit them in place and the copy at work is automatically updated as you go.

So basically an IP nightmare for many companies?

No more a nightmare than someone bringing in a flash drive and copying the file to it before they left. You'd only have access to things you already had access to.
My girlfriend can't even access her work email unless she uses a company sanctioned laptop.

Sure that's just because she doesn't know how to set up VPN access on her own, but still.

Right, but there are still access control settings in Plan9 that would be able to limit access if the administrator chose to do so, there is just more flexibility to what can be done by default.
I wouldn't be so sure. Allowing employees to move arbitrary hardware running arbitrary software into their VPN is a security risk many companies do not want to take.

That is why it took pressure to get iPhones into enterprise networks.

I just got into a mess where the company VPN uses a windows/mac specific client, no linux version and no way to access the VPN. So knowing how to set up VPN access 'on my own' is currently of no use to me.
It was mostly an example. And it's relatively to avoid the IP issues. Just don't let employees personal computers be part of the corporate Plan 9 system.
But that's already the case if you company uses Google Docs or Office365.

If a company is intent on constraining access to data from its office space only, then it wouldn't select or open itself to such systems.