Hacker News new | ask | show | jobs
by kccqzy 698 days ago
> The Plan 9 implementations tend to not be as feature rich as the proper upstream variants.

This is IMO the biggest drawback. Why wouldn't any user want the software to be feature rich? In fact, looking at Plan 9, I often feel that the provided software is just a MVP.

5 comments

Counterpoint: Plan 9 is supposed to be the ultimate realization of the Unix philosophy. One important aspect of the Unix philosophy is composable software. Instead of large, feature-rich programs where functionality is often siloed off from other programs, users have a toolbox of small, composable programs that “do only one thing and do it well” and that they could connect together using pipes and other inter-process communication primitives.

Composable software is something I’m highly interested in. There were efforts in the 1990s to make desktop software more composable, such as COM from Windows and OpenDoc from Apple, but the desktop world is still dominated by large applications such as those that constitute Microsoft Office and the Adobe Creative Suite. It would have been a wonderful opportunity for the Linux desktop world to embrace components, but, alas, the community embraced OpenOffice, GIMP, and other large applications.

That would be Inferno, not Plan 9.

COM is everywhere on Windows, specially since Vista, as the WinDev regained the control they thought Longhorn was going to take away from them.

One of Powershell strengths is the easy access to COM, just like .NET, frameworks.

Linux could do the same with D-Bus, but alas so is the distributions wars, and hate on anything like proprietary OSes, that it only has a minor role on systemd, GNOME and KDE.

Intuitively this sounds like asking for dependency and API hell?

Imagine writing a huge complex program that is dependent of communication between smaller existing programs. Either you use the default programs that where shipped with all the different versions of OS'es with different distro's (never going to work, too many different versions of programs and their communication interfaces) or you ship certain fixed versions of all of the small programs that form your bigger program.

In case of the latter: why not just use libraries? It's basically the same thing with an easier API?

Maybe I'm missing something...

A “program that is dependent on communication between smaller existing programs” is essentially the definition of a shell script, and those are usually not as problematic as your describe until you go out and try different independent implementations of the tools as opposed to mere versions. Compatibility problems definitely happen, but not as often as you seem to expect.

I’d guess the trick is that you’re not thinking small enough. GNU coreutils, etc. are not minimal by any means, but compared with even late-90s graphical desktop software they are still fairly compact, and you’re rarely using each and every tool at once. And the smaller the tool and the problem it targets, the more likely it is that the problem is mostly a solved one, so interface churn is less necessary.

I’m not sure every problem area is amenable to this—GUIs and things best expressed as GUIs seem particularly stubborn. (It would be sad if OLE/ActiveX was the best possible solution.) But some are, and few enough people are trying to expand the simplicity frontier for their real-world tasks in recent years that I don’t believe the state of the art of the 1980s is the farthest it can reach, either.

These programs are effectively libraries. They implement a known interface.

Except at the end of the day, the interface can be as simple as a stream of bytes over a socket. If I want a h264 decoder in my application I could just pipe a stream to a specific program made to decode it. That could be written in Python, in Rust, in C, in Go, etc. whereas dynamic libraries don't give you that freedom as you have to abide by the ABI defined by the host application.

Components are libraries, which aren't stuck in a C view of UNIX world.
It's more like Plan 9 is an evolution of unix and inferno is an evolution of plan 9.

Also there's the old viewpoint of "let's put everything in XML. Everything can read and write XML", and that seems similar to the argument of "everything can be an object that is exposed to other programs". The problem in both cases, objects have requirements for function call names, function arguments, nuanced conventions, as XML has specific tree structures. Interfacing programs must be wise to these conventions and sometimes nuances so it doesn't "just work". Windows is like - programs CAN share objects and interface BUT it needs developer work for program A to work with program B. Unix is like "programs X and Y, whatever they are, work together with no additional work". The magic of unix is that if there are 1000 programs, now there are 1,000,000 combinations that "just work" vs. 1,000,000 developer hours

Unix on the other hand recognizes that it's a lot easier to just say "everything is a text stream, and all programs are responsible for inputting and outputting only fairly clean text streams without extraneous output" . This is extended to "everything is a file", a file also typically made to be read into a clean text stream so it can feed into that whole ecosystem.

The irony is that Acorn's RISC OS arguably came the closest to this ideal with any pragmatism. The way that file choosers worked effectively allowed one to pipe a saved file from one application to another and then do it again through the same workflow in the next application and so on.
This kind of IPC lurks in every major OS, drag to an app window is supported by Xorg Mac and Windows.
I suppose this is IPC in the loosest possible sense? It's more like GetOpenFileName() and GetSaveFileName() in Win32 but getting handed a HANDLE outright instead of an LPCSTR to pass to CreateFile() later.
Agreed. And one could argue that Unix wasn't really popular because of the "philosophy", but because it would get out of the way and let you run big monolithic applications like OracleDB or CAD software or even Emacs and etc. So no popular application using "Plan 9 philosophy" ever emerged.
I suspect the appeal of the Unix Philosophy is strongest at the earliest phases of the system's evolution.

Once you've written some very basic boostrap tools, the "second generation" of stuff that adds convenience and flexibility are a lot simpler.

A trivial example: 20 seconds after you wrote "directory listing", someone will say "I want a directory listing, but sorted by date, and it would be awesome if it didn't immediately scroll past the end of my screen."

With Unix Philosophy tools, you might already have have a "sort" and "paginate" command, so it's just piping stuff together. They can do it themselves, or it will take 20 seconds to explain.

Without it, you're going to have to add additional options to "directory listing" (or parallel commands) to handle the sorting and pagination features. The tools get bigger and buggier for the same functionality.

Early Unix machines weren't much bigger than mid-80s PCs-- 512K of memory or less-- but offered a very rich command line experience compared with DOS machines of similar sizes.

Programs like database or CAD packages probably go monolithic because they're more "state dependent" than your usual command-line tools. "sort" and "more" can take their inputs from stdin and feed them out to stdout, and when they're done, forget everything with no damage.

That wouldn't work well for other packages. You could probably make a database or CAD system that worked as composable units, like `echo db.sql | db-query "select username from accounts where credit < 0" | xargs delete-account` or `echo image.dxf | add-circle -x 200 -y 400 -r 60 > image.dxf` But you'd spend a lot of time reloading and reparsing the same files. A persistent monolith that keeps the data file open and in whatever internal representation is most efficient is going to perform better.

Some use cases also have limited composability, because the user can only plan a few moves ahead. Tools that encourage interactive/experimental usage, like drafting software, might involve the user stopping every step or two to make sure they're staying on plan, and queuing up a series of commands could wreak havoc. Some of these packages ended up simulating composable tools through internal macro/scripting languages which still avoided the penalty of having to rely on the OS to orchestrate every single action.

> With Unix Philosophy tools, you might already have have a "sort" and "paginate" command, so it's just piping stuff together. They can do it themselves, or it will take 20 seconds to explain.

Sorting the output of textual tools like ls requires parsing which can be non-trivial. It's easier to do it by using a modern structural shell such as nushell.

The pipeline part and the "do one thing well" can't make anything structurally serious for the layman. But Unix had gaps for that, that plan9 in its ways fills: it has GUI, a better shell language, coroutines and file servers. The application then has to be glue code you'd write in C or Rc, you may write pipelines for some things your application does but nobody can do Excel (the way Excel does) with just a pipeline...
Imagine extending Plan 9 semantics with something like REST style protocols, but via the (virtual) filesystem layer rather than HTTP requests.

(Offhand, I've never touched Plan 9 but...) Hypothetically /proc/SOMEPID/db/DATABASE/SCHEMA/TABLE/various views which provide expressions in some order. Or /proc/SOMEPID/containerofthings/ and the directory listing is serviced by the application, as an enumeration of keys (filenames) to values (datasets). For a database the API would behave similarly to how ORMs operate since filesystems are inherently similar to objects.

Why be dependent on the /proc/SOMEPID/ path? Just write your process as a plan9 file server, and expose it in some arbitrary part of the filesystem.
I agree, but I believe the fact there are no popular applications that fully embrace the Unix/Plan 9 philosophy is the point of the philosophy. Generic tools that can be composed versus end-to-end applications. Both have their advantages and disadvantages, though component-based software doesn’t preclude the development of end-to-end applications using these components. In my opinion I believe the reason end-to-end applications are dominant is because it’s easier for companies to sell and market products over tools. Part of the reason OpenDoc failed was because companies that made a living selling end-to-end applications (like Adobe) didn’t want to adopt component-based software where the product (application) isn’t the main focus. Imagine if users could construct their own Photoshop out of discrete elements.
There were plenty of ActiveX lego components to build Photoshop like applications on Windows during the 1990's, back when buying libraries was a thing professionals would care about.
Even the UNIX philosophy is something that gets praised all around on UNIX FOSS circles, which I seldom saw anyone carying about on commercial UNIX systems, starting with my introduction to Xenix in 1993.

It kind of feels a bit of cargo cult, praising it all the time.

The plan9 philosophy can't exist because there are no more three-button mice... UI aside, you have very cool technical differences with UNIX and most important of all daemons are file servers, you don't have to create or learn any new query style and path layout to work with them, you interact with parts exposed from a program writing (to) files and reading them, you don't necessarily need to read big chunks of data either if the program can expose just fragments.
Both KDE and GNOME started out with components. GNOME was originally the GNU Network Object Model Environment and KDE had KParts.
For the same reason people prefer languages like Python over Perl. Simplicity improves usability and understandability.

It's pleasant to use a minimalist, viable product.

9front is not the only OS I use, but it is one of my daily drivers.

Hey Ori :) I particularly enjoyed your video talk "not dead just resting" - thanks for everything you do

https://www.youtube.com/watch?v=6m3GuoaxRNM

Python started out decades ago as a language for beginners or non-professional programmers, but is the current language simple or minimalistic?
Not at all, it has C++ complexity level, if one wants to master it at all levels.

Additionally, since even minor versions introduce breaking changes, getting something from e.g. Python 1.6 to run on 3.12 is an exercise in trial and error, or unexpected surprises at some moment at runtime.

> Not at all, it has C++ complexity level, if one wants to master it at all levels.

Would be interesting to hear what levels you think those are because as someone who has been learning and writing C++ and Python for over 20 years now, I'd say there's no level of Python which comes even close to the complexity of C++ at a comparative level.

> getting something from e.g. Python 1.6 to run on 3.12 is an exercise in trial and error, or unexpected surprises at some moment at runtime.

Fair enough. But then again: that's irrelevant for any new project written since about the start of the last decade. And to continue the C++ comparison: whereas Python 1 -> 2 -> 3 imo solved some real issues, the consecutive C++ standards never did this resulting in something which is, yes, backwards comptible (roughly - try getting 30-40 year old code getting to compile with /std:c++latest and /Wall - or look at all those tiny behavior changes between the last couple of standard iterations) but also seriously plagued by that as it holds back innovation. Modern C++ minus a lot of the old UB-prone stuff would definitely be better and less complex than what we have now.

Easy, mastering the language (everything you can do with it, everything!), the main language runtime, the C extensions API, and the complete standard library.

Then just like C++, add the set of key implementations, CPython, Cython, PyPy, key libraries everyone uses (parallel to Boost).

Since you have such a wide Python experience, naturally you already printed out all the PDFs of Python documentation, and read them cover to cover.

I did such thing back on Python 2.0 days, and it only grew bigger.

How many pages was it again?

The dynamic and metaprogramming parts of Python can get pretty complicated, especially when it's done in a large program/library like SQLAlchemy.
I now describe python as enjoyable for the author and miserable for the user.

If you give the tiniest of Fs for your user, do not write your thing in python.

Python isn't simple.
Perl is less simple. Though, I suppose lua would be a better comparison.
I fail to see your point. To me, these three are all very close to each other in "simplicity" and any ordering seems arguable. If anything, isn't Perl simpler than Python and if not, why?

Perhaps vast differences in ergonomics and language-culture-fit but that's orthogonal/unrelated?

The point is that simplicity is an ergonomic consideration, regardless of how you nitpick the analogy.
In context though, you gave it as an example why people would not want more feature-rich software.

The supposed simplicity of Python over Perl has nothing to do with Perl being more feature-rich and that compromising its simplicity.

It seems like Plan9 would get closer to "Python simplicity" by adding features and extending interfaces. Which would be at conflict with the "minimalist MVP simplicity".

You present it as mutually exclusive. I believe it's the same word used for two fundamentally different aspects of software - less of a nit.

Lua is great, and `eval "$(luarocks path --bin)"` in your ~/.bash_profile or ~/.bashrc seems fine, better than Perl's where you gotta export PERL5LIB, PERL_LOCAL_LIB, PERL_MB_OPT, and PERL_MM_OPT, for example.
He didn't say Python was simple. He mentioned simplicity, those are different things.
Python's `venv` Just Works (and is standard), while whatever it was that I dug up to get the same effect in Perl mostly didn't. I somewhat prefer Perl for things where this isn't an issue.

I should probably make time look again in case I missed something or it's improved in the last decade.

> Why wouldn't any user want the software to be feature rich?

Users want feature rich systems. Individual programs are best feature-complete, but focused on a single task and capable of cooperating with others when something out of scope is desired.

From my personal viewpoint: It's not easy to hack on large monoliths, even for senior software engineers. But if every logical piece of the monolith tries to be as small as it meaningfully could, the barriers are drastically lower.

It is a personal choice of course, but some people enjoy the feeling of fully learning a piece of software, which is impossible with most.
Because there's diminishing returns on effort for each feature and some features just don't fit well with in plan9. And sometimes there's a workable alternative.

Lastly, it's really not for general users. It's for (academic?) computer people who are dexterous and willing to try new things.