Live data from Hacker News

Linux Namespaces Are a Poor Man's Plan 9 Namespaces

yotam.net

101–110 of 311 posts

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#101
post #47

The simple, everything is a file, model of Plan9 is what makes the namespaces API as clear and as general as it is. All the objects export the same file API. Every interaction with the OS objects is done through file open, create, read, write, etc. But it has it's drawbacks. First, it's not always easy to map every object operation into either an open read or write. With time, we should have seen a lot of ugly interf…

> First, it's not always easy to map every object operation into either an open read or write. It doesn't seem like it. Linux has a habit of multiplexing alternate functions through a single handle with additional and somewhat scary methods like ioctl. Plan9 manages this with servers, directories, and more than one path available for a single resource depending on what you're trying to access. This is far more sane.…

And in exchange for that performance we got one of the most insane /class/ of unfixable CPU bugs ever imagined.

What do Spectre and Meltdown have to do with “everything as a file” system architecture?

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#103
post #62
post #42

Earlier quoted context omitted.

The thing that I use find for most commonly is to perform a hierarchical grep, i.e find . -exec grep -Hn regex \{\} \; How would you do that with the du | grep combo?

grep -R

but old habits die hard :)

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#104
post #84

I have used Plan 9, and found it is a poor man's Linux.

More like the reverse. Coding in 9front's C from the book from Francisco J. Ballestero's felt and still feels like the future today. Golang for example borrows lots of stuff from 1-9c compilers from plan9/9front, Limbo and Plan9 design such as static binaries and cross compiling from anywhere to everywhere.

[flagged]

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#105
post #72

The Plan 9 design wasn't as great as people like to think and it wouldn't have survived in the advertised form if Plan 9 actually had taken off. Actually it was already losing that aesthetic coherence quite early on in its lifetime. Hierarchical nouns, a fixed collection of verbs and a stream of bytes is aesthetically pleasing and can be helpful for developers hacking around, but is too limited and low level a vocabu…

A model need not be copied to be better. IMO there are lots of reasons for people to pursue their own ideas or ideas that don't require fundamental upgrades to their operating system. I can also imagine doing the reverse of what you suggest in that libraries could implement fundamental mechanisms like RPCs and the file model would just be one form of interface to them. This would enable all programs to work to a mini…

Yep.

It's fairly common for RPC systems to grow a little shell at some point that lets you arrange objects hierarchically and invoke methods on them. Files then just become objects that support the IFile interface. Mojo had one but it was deleted, and before doing Android the BeOS folks did "OpenBinder" which also had such a shell. There were some attempts at shell-like things in the JVM space as well, I've used CRaSH in the past.

There's a lot of scope for interesting OS research here. One issue is that OOP is a bit too dogmatic. Filesystems separate code from data, but OOP is all about fusing them together. If you try and embed an object with an API into the filesystem (e.g. /dev files) then you get stuck when wanting to change the code whilst keeping data constant, which is something that happens all the time with things like image formats, HTML, text files ... operating systems have relatively crude notions of file associations which could be improved a lot.

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#106

Earlier quoted context omitted.

> The same person Go was designed by: - Robert Griesemer, known for nothing else, - Rob Pike, primarily known for sam(1), acme(1) and several other Plan 9 tools, the Blit (Unix's own graphical terminal), UTF-8 (with Ken Thompson), Inferno and Limbo, - and Ken Thompson, ancient god.

All these things you listed are objectively bad and a tumor and I'm glad that those that are gone, are gone for good, because the one that stayed is a menace to any programmer caring about his sanity.

[deleted]

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#107

Earlier quoted context omitted.

> The same person Go was designed by: - Robert Griesemer, known for nothing else, - Rob Pike, primarily known for sam(1), acme(1) and several other Plan 9 tools, the Blit (Unix's own graphical terminal), UTF-8 (with Ken Thompson), Inferno and Limbo, - and Ken Thompson, ancient god.

All these things you listed are objectively bad and a tumor and I'm glad that those that are gone, are gone for good, because the one that stayed is a menace to any programmer caring about his sanity.

What's wrong with Acme?

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#108

Earlier quoted context omitted.

io_uring is a more modern API to file access. Actually I think it would be great if everything was a file and the communication with the kernel was only with io_uring.

> it would be great if everything was a file This is a bad design. Process is not a file because you cannot send signals to a file, or cannot debug a file. Network socket is not a file because you cannot get file's peer address. Shared memory is not a file. And so on.

Why would (pseudocode, nonexisting but possible example) write(SIGKILL, "/proc/12345/signals") not be possible? For the other direction, there is signalfd in Linux. And of course you can get a peer address from /dev/tcp (https://andreafortuna.org/2021/03/06/some-useful-tips-about-... ). Yes, /dev/tcp is not an OS primitive but a bash builtin, but there isn't really a reason you cannot do this in the OS. Shared memory can be a file, you just have to mmap() it. mmap is always left out of the open/close/read/write-enumeration of the traditional file API, but I think it is actually extremely useful and should be the fifth alongside those.

Debugging is hard to imagine, yes. One could look at /proc/12345/mem, write breakpoints in there, but I'm not sure about how to do the more exotic things.

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#109

Earlier quoted context omitted.

Sure, which lends weight to the idea that the shell should be a more extensive programming language. Then you can pass an arbitrary Predicate to the finder (which would likely just be a convenience function of about 5-20 lines), and receive a list of file objects for you to do what you want with That's the direction Powershell took, and to some extent was what other OSes were doing at the time of Unix. But Unix has b…

"That's the direction Powershell took, and to some extent was what other OSes were doing at the time of Unix. But Unix has become so ubiquitous and influential that we've forgotten that programs could pass more than ill-specified strings around ... The first step would be to stop putting "Unix philosophy" on a throne " Well yes, but I think it will be hard or rather impossible to convince the unix crowd of anything g…

There are still tons of stringly-typed interfaces in powershell.

Re: Linux Namespaces Are a Poor Man's Plan 9 Namespaces

#110

Earlier quoted context omitted.

io_uring is a more modern API to file access. Actually I think it would be great if everything was a file and the communication with the kernel was only with io_uring.

> it would be great if everything was a file This is a bad design. Process is not a file because you cannot send signals to a file, or cannot debug a file. Network socket is not a file because you cannot get file's peer address. Shared memory is not a file. And so on.

When everything is a file, what is a "file" becomes flexible.

In Plan 9, you send signals and messages to a file by writing to it. And read messages by reading from it.

It's in essence no different than OOP or actor model or what have you.

Post reply on HN