81 points · by Lwrless · 3y ago · 158 comments
The failure of Plan9 is not about what went wrong or right. It is about how the market evolved and made decisions, which goes beyond the scope of this comment.
The first conclusion "...is not to try to fix things that are not broken..." is dangerous because what someone identifies as broken is not the same as someone else. As a Plan9 user you may identify Unix deficiencies as problems and a Unix user might disagree.
The second conclusion "...is to try to identify if there is a market..." and there are many things in life that contradicts this (maths, basic science, maybe the beginning of Unix itself...).
And the final conclusion is about backwards compatibility. This is sound in the authors perspective because of the first conclusion but does not hold against good reasoning. Plan9 broke some compatibility because it needed and kept others because they were already good in the POV of the developers/researchers.
The Plan9 effects to me is far different. It is about the fact that Plan9 is unable to die against all expectations. 9P is there to stay, 9front gets releases every year, /proc is everywhere, same for UTF-8, and so on.
Good ideas stick, they are hard to let go and even harder to ignore. Plan9 failed in the commercial OS sense, just as many others failed. "You may never know it's broken until you fix it" (I'm sure heard it somewhere).
Horrible ideas are even stickier unfortunately. Like Unix, Plan 9 is also designed around forking processes and even has asynchronous signals.
Granted, it's sometimes weird that in order to have a process running image A create a process running image B, it must first have a mirror image of itself for a while, then replace it. But the symmetry and simplicity at the conceptual level is nice, and the ability to have code for both parent and child in the same image is neat.
The problems with fork are thoroughly explained by this Microsoft paper:
https://www.microsoft.com/en-us/research/uploads/prod/2019/0...
As for asynchronous signals, they are a completely broken concept and implementation.
It's not safe to do pretty much anything in a signal handler other than setting a flag and returning. You cannot use any non-reentrant function which eliminates pretty much everything useful, including the vast majority of standard library functions.
The system drops events. Signals are essentially a pending delivery flag in the kernel, signaling a process just sets the flag to 1 so there's no difference between doing it once and 10000 times.
Was in a system call when your process was signaled? It will be interrupted or cancelled. It returns EINTR and your code needs robust retrying logic to handle such a case. I've seen code that couldn't handle it and crashed.
There's race conditions everywhere. Signals can arrive while you're handling other signals, you need to block block them if you don't want that. Every thread has its own signal handling behavior. Signals sent to a process are handled by "any" thread. I remember reading in some standard that using signals in multithreaded programs was undefined behavior. Who even knows what's going to happen?
The only borderline sane way to handle signals is with file descriptors: you block traditional signal handling on all threads and set up a signalfd that you can epoll along with everything else on a thread dedicated to the event loop. Even this is pretty bad:
Multithreaded app? Fork is now a liability, and is only useful if the only (more or less) thing you do in the child is exec. Might as well only have Windows-style CreateProcess at that point.
For single-threaded programs, sure, fork is fine and gives you more flexibility than a CreateProcess-type API.
Asynchronous signals have a lot of the same problems, but those problems are also present in single-threaded programs. Quite a few APIs have been added over time to try to make working with async signals easier and safer, but all of them add their own new gotchas.
Forking is good because it saves you a rich process manipulation API, and because generally speaking doing things to an execution environment always ends up more clunky than doing things in one. (Cleaning up after doing them is another matter.)
Forking is bad[1] because it (essentially if not literally) forces memory overcommit on you, at which point resource accounting becomes hopeless.
Market fit is insight 20/20 IMO, but you phrased it better.
Overall, my discomfort is that it’s the type of reasoning that keep you with your two feets in the mud. Stuck.
I’m stealing “you don’t know it’s broken until your fix it”
Personally, I don’t like that it’s more of parsing text files to get a number, when you could have functions returning structs (of variable length, to get extensibility, while preserving backwards compatibility).
The array of encoded bytes despite it's complexity overhead has an advantage in that is lays on the human visible side of computing, that part of computers designed for the human to use. I have to admit more often than not I prefer to eat the overhead and have an interface that I can see.
That is infinitely more stupid than procfs.
The text format is a problem on its own tho, "procfs but serialized using single format" would IMO be a best middle ground between tying your app to essentially kernel headers and parsing a bunch of random textfiles
That's a noble wish, but that doesn't make it true.
Then it's not really good, but merely good-looking.
People liked Unix because it was free – either really free, via BSD, or as a Unix derivative provided at no cost when people bought their workstations. A new revolutionary operating system had absolutely no reason for anybody to buy it: No commercial developers wanted to develop to a platform without users, and no users wanted a platform without software.
This is wrong. The influence is far wider than you realise.
The PS/2 standard for keyboards and mice is perhaps the only one that bears the name PS/2 but it is very far from the only standard that came out of the PS/2 range.
VGA is a PS/2 standard.
The VGA port and the still-ubiquitous SVGA plug and the SVGA modes is a PS/2 standard.
My Core i7 nVME-only native-UEFI laptop still has both these ports on its vendor-supplied docking station.
3.5" HD 1.4MB floppy drives are a PS/2 standard. TTBOMK the 3.5" hard disk bay is also a PS/2 range innovation: while tower PS/2 machines came with 5.25" hard disks in the early models, the smaller desktop machines came with 3.5" hard disks. That was certainly the first time I ever saw a 3.5" hard disk and I vividly remember being boggled by how small it was.
PS/2s predated the rise of CD drives and optical media. The desktop ones didn't have 5.25" bays. That drove the success of 3.5" hard disks.
But the floppy drive was more influential. If you have an old PC with a floppy drive, then it's a PS/2 format floppy drive.
More to the point, the PS/2 range is the direct reason that Microsoft Windows was a success. The widespread success of Windows is what created the conditions for Linux to be written.
The reasons that the PC industry exists and thrives today is the IBM PS/2 range.
I had to try to explain this here on HN recently, as in just this autumn, and while I can't find that comment, here's the blog post I made from it: https://liam-on-linux.dreamwidth.org/87108.html
And that itself caused considerable discussion here: https://news.ycombinator.com/item?id=33019019
Real problem where other vendors, which offered new hardware (with for example, new CPUs), before IBM.
First case was Compaq-386, which considered by wide public as brand, and appear on market, before 386 machine from IBM.
As I know, Compaq-386, was not much commercial success, but it shown people, they could buy excellent hardware from other brands, not only from IBM.
And after this happen, it made PS/2 series not so interest, as before.
Incidentally, Compaq really put it to IBM with their lunch box style portable 386 and 486 models.
What also works: make something completely unique which nobody is able to competently reproduce or replace. Lock it down heavily, reap the benefits. Examples: Apple, maybe Nintendo. Hardly anyone else: the order is really tall.
What does not work: make something fine but not uniquely great, lock it down. Failures are by the thousand.
Good point, but have You hear abot, https://en.wikipedia.org/wiki/Perfect_is_the_enemy_of_good
That is the point, that better things must be hugely better, than ordinary, to win.
For example, my friend worked in startup, based on Erlang. Once at public talk one guy asked "have you hear about Erjang, a virtual machine for Erlang, which runs on JVM, it is up to 5 times faster than Beam?". Answer was "5 times faster is not enough, to consider switch of platform, in my case, need 10 times faster".
Yeah that's not true, at the beginning it was ~10k per processor. But you can thank Berkeley for rewriting Unix and replace all the AT&T parts. And yes SunOS was from the BSD lineage.
https://www.quora.com/How-much-did-Unix-cost-during-the-70s-...
They could not sell a product but the licenses.
Was Unix popular at that time?
And for West it was normal price, because even considering wide usage of also cheap CP/M, on some level of organization size, was unavoidable to switch to Unixes or to mainframe - CP/M just was too limited, was not capable to handle big business load.
When BSD first appear, Unix machines also where too small and slow for big business, but very soon appear client-server architecture, and later clouds (Beowulf, I think, oldest wide used private cloud soft), Unixes become unlimited.
Second system syndrome is not about "trying to make improvements to a first version of something and failing in the market".
It's about trying to make improvements and ending up with a convoluted mess. The Wiki definition is literally: "The second-system effect or second-system syndrome is the tendency of small, elegant, and successful systems to be succeeded by over-engineered, bloated systems, due to inflated expectations and overconfidence.".
That's nothing like Plan-9, whose developers insisted on a simple elegant small design, with the original ethos of Unix, kept it KISS at all times, and if anything made it even simpler and more coherent than the original (which is why Linux copied all the major Plan-9 features over the years).
Failing in the market is orthogonal to this being (or, in this case, not being) a "second system syndrome".
The reason for that was that it was a proprietary platform, the existing unices were "good enough" for it to gain traction, and it came at a time that companies turned first Windows NT and soon after Linux. Besides ALL traditional UNIX vendors failed and most folded at the same period.
Transparent distributed single system, for example. The strange and unexplainable obsession by so many computer systems developers. The reality is almost nobody wants it, yet Plan9 was almost entirely designed around this concept. A complete boondoggle. Even the nerdy people who get a kick out of this kind of thing will set up a single system distributed cluster and run a few commands and say "hey that's neat" and then go back to using Windows or Linux, complete with tools for remote administration of systems, and applications that can do clustering and distributed systems in the cases where it's necessary or helpful.
But...the were hugely influential. Someone once said that they may have only sold 500 albums, but each an every one of those purchasers started a band.
Success needs to be carefully defined in advance of declaring failure.
Crazy to think they are an absolute must listen to high school kids ( at least in rural France of the 90s… )
Key word: RESEARCH.
OpenBSD gets a lot of flak for this, which is funny because outside of its performance issues which are somewhat the result of all the mitigations, people sure love taking things that were first implemented there and using it in stuff like Windows, or using software which is an integral part of that project like OpenSSH and tmux. I don't think some people realize that it's largely a research project led by professors out of universities in Alberta when they're really quick to heap criticism on it.
UTF-8 alone would make it a success.
Plan 9 and Inferno failed at that, because AT&T had already changed by then, and there was no more free beer.
Beyond all that, today's leading OS, Linux, has incorporated many of Plan 9's ideas. /proc filesystem, the signalfd system call, and UTF-8 are all examples.
I think it's dangerous to assume what this article advocates. You risk trying to make a faster horse, or maybe the Uber of $X
I do think that Plan9's de facto requirement for graphics-capable hardware is a bit weird in retrospect. It really was made to be a research OS for networked workstations (and the default UI basically clones Oberon) even though the design concepts it ultimately leverages are far more applicable.
Graphical workstations were always the desired end result for decades since the mother of all demos. In the 90's GUI's were all the rage: Windows 95 removed the need for DOS and MacOS was already leading in this space. So it makes sense that plan 9 was designed to be graphics first.
That brings up another point; UNIXes v8-v10 are even more irrelevant and forgotten than plan9, despite presumably being more compatible with the venerable v7 UNIX. So pinning plan9s failures on it being different seems to me very misguided
Hang on, what?
AFAIK UNIX 10 was the last ever version.
I was complaining about the missed promise of file abstractions since the first time I was exposed to their potential: "Oh, that's great - but then, why isn't XYZ accessible as a file? And why can't we have the kernel offload interpretation of path suffixes to userspace code? And why isn't `/proc` richer? And why do I need to mess around with BSD sockets if we can just go through files? etc. etc."
Now, sure, I'm just a nobody (and was a complete nobody 25 years ago when I noticed this) - but the author's claim is just false.
Just the last week I needed a replacement for a container init that watches the process outputs and kills the process on timeout. Surprising, but I haven't found anything readily available, so I had to hack my own tiny program.
I haven't done much system programming any recently so my knowledge was kinda rusty. I knew the basics of what I should do - I had to wait on the child PID, watch out for the signals (because I'm running an init process, can't keep those zombies around), and work with the piped stdout/stderr fds. Sounds trivial, except that it's three completely independent APIs and those aren't files so select(1) is not my friend here. So I learned about signalfd and then learned how it's broken. Almost thought I have to run some threads but then I've learned about pselect(1) which seem to do the job.
Either way, "gosh, I'd wish I'd have Plan 9 instead of all this mess" was one of my thoughts that day.
I see a value in being to abstract away hardware issues as it lets me reduce the complexity of what I’m working on. Operation within an abstraction can be improved or changed without changing what uses it - and the changes are made in a single place, simplifying maintenance. There can always be performance issues, but one should not set out to tune things without a reason to.
I think a better conclusion is that Plan 9 blew their "weirdness budget". I can't remember where I read it (either here or Reddit) but someone stated the idea of a weirdness budget.
If you're making a new thing it can only be a bit weird and different. If it's too weird people will just stick with what they know and you'll be relegated to a research project that nobody uses.
Inferno is, for me, much easier and saner to use.
Inferno is to Plan 9 as Plan 9 is to UNIX: taking the ideas further, fixing the rough edges and making it more versatile and more general.
But Inferno is even more obscure and forgotten than Plan 9.
Some 15Y ago I was able to find an ISO image of x86-32 Inferno and boot it in a VM. Not today. :-(
First sentence is false. Confidently, arrogantly false. I'm hesitant to continue reading. Assuming too much of your audience like that can really detract from what you have to say.
A pet peeve of mine is statements like that… just because you just learned about something doesn’t mean other people didn’t know about it before. Even if you ask all your friends and they don’t know, that doesn’t mean different circles don’t know about it.
https://www.joelonsoftware.com/2001/04/21/dont-let-architect...
All abstractions leak. The more surface area an abstraction covers, the more leaky it is likely to be.
But if you've ever worked with it then you will be longing for exactly those features forever and wondering why we did not manage to take more of its deep insights forward.
A lot of really good ideas have been slaughtered on the altars of commerce and perceived performance improvements. As a result we are still developing software roughly the same way that we did 50 years ago, a model that wasn't ideal but that was good enough.
Everything is a file is even slower than micro-kernels IPC.
Making a simpler API is a great idea, and from you comment I guess they mostly succeeded, but they did not have to go down the everything-is-a-file path to do that.
What role this played in lack of adoption depends on what alternate course of action you compare it to. A non-file-based rewrite of the API would likely have had approximately the same result, in any case a good compatibility layer might have made a big difference.
As others mentioned, the author also needs to consider what research is.
Minix 3 is a very different OS, with a different design, different goal, and different licence.
It's very important to distinguish between them, or else you make statements that sound akin to "Anglo-Saxon is the main language of trade in the 21st century."
The Plan 9 Effect or why you should not fix it if it isn't broken - https://news.ycombinator.com/item?id=11791980 - May 2016 (107 comments)
Pretty sure I knew what both Plan9 and Inferno were by 2001.
Ask Guido van Rossum re: Python 2=>3.
Given how smart Pike, Thompson, Ritchie etc are and we're, I doubt this is a coincidence!
I must admit, this is good article, because it illustrating different styles of thinking, and using excellent example of really great fail, but absolutely avoidable.
Unfortunately, it is written considered tech people, in language of tech people, on resource intended for tech people, but it is much closer for entrepreneurs, business owners, investors, freelancers.
I could not add much to what already mentioned, except, that exists huge number of examples, when big corporations used best scientific research and fail.
This is because scientific is right in only some dimensions of space-time and https://en.wikipedia.org/wiki/Noosphere, which are accessible for current science (and not right in huge non-digitized areas.
And usually, researched really past, but product is made for future, and future is mostly unpredictable for current science.
As summary of my comment, when use research data for work, you risque, to make product for some abstract market, existed in past, but will not exist in future.
Of course - this happens all the time. But I'd argue this is definitely not what happened with Plan 9. I think the article mentioned this as well, that Plan 9 was not really made by business people with commercial interests in a software company with experience. It was actually the polar opposite.
The people that worked on Plan 9 wanted to make a better system. I don't call it a failure, I call it an enormous success. It of course failed as a commercial product, but that was an afterthought from the beginning.
I digress. You said that Plan 9 was designed for a future that never got to be. What about all its legacy? All the things that I'm sure I don't have to repeat, that got into every other system eventually. Someone earlier in the thread mentioned a weirdness budget. I think that's the best explanation. Plan 9 finished up their weirdness budget about 5% in. That made it an awfully good system that nobody used. We need systems like that to show us what's possible, but they'll never be mainstream.