News for hackers. Stuff that matters.
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by DonHopkins on Friday June 28, 2019 @10:57AM (#20304909)
"Everything is a file". Except ioctl. Except mmap. Except the shell makes it a huge pain in the ass to hook up arbitrary graphs of streams between processes.
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by tntn on Friday June 28, 2019 @12:02PM (#20305716)
EDIT: I'm too old for this. Think what you want about mmap and ioctl.
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by DonHopkins on Friday June 28, 2019 @12:04PM (#20305735)
My point is that ioctl and mmap disprove the "Unix Philosophy" idea that files are one-dimensional streams of characters that are all you need to plug programs together.
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by uep on Friday June 28, 2019 @12:16PM (#20305891)
Do they though?

Everything as a file is an abstraction, an enormously useful abstraction. The point isn't that it has to behave like a file in every way. At the C level, the fact that open(), read(), write(), or e/poll() behave the similarly is extremely helpful.

I can have a whole suite of functions that do not care what type of file descriptor they hold, but just that those functions behave in a predictable way. Maybe only 10% of my code has to care about the differences between them, instead of 70%.

Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by pjmlp on Friday June 28, 2019 @12:12PM (#20305837)
Except sockets, Sys V IPC, GPGPUs, better then?
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by p_l on Friday June 28, 2019 @01:16PM (#20306598)
BSD Sockets were never part of "UNIX Philosophy", they are an ugly quick'n'dirty port/rewrite of code from totally alien system (TOPS-20) because DoD had to deal with vendor abandonment
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by danarmak on Friday June 28, 2019 @01:53PM (#20307016)
And in the 35 years since, despite multiple new kernels and userlands and languages, a more unix-file-like socket API hasn't become popular. I'm not sure what does that tells us, but it's not nothing.
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by p_l on Sunday June 30, 2019 @09:14AM (#20318024)
Interestingly enough, Go's network functions, by virtue of being native to Plan9, actually are based around Plan9's file-based network API. It works pretty nicely, though "everything is a file stream" has its issues.

Government, Politics, resistance to change, NIH syndrome, "us vs them" and a bunch of other issues all conspired to keep BSD Sockets alive.

The first is the origin of BSD Sockets at all - UCB got paid by the government to port TCP/IP to Unix and, AFAIK, provide it royalty-free to everyone, because DoD needed a replacement for TOPS-20 as fast as possible and widely available, and there were tons of new Unix machines on anything that could get paging up (and some that couldn't).

Then you have the part where TLI/XTI ends up in Unix Wars, associated with slow implementations (STREAMS), despite being superior interface. NIH syndrome also struck in IETF which left us with the issues in IPv6 development and defensiveness against better interfaces than BSD Sockets because those tended to be associated with the "evil enemy OSI" (a polish joke gets lost there, due to "osi" easily being turned into "axis").

Finally, you have a slapped together port of some features from XTI that forms "getaddrinfo", but doesn't get much use for years after introduction (1998) so when you learn programming BSD Sockets years later you still need to manually handle IPv4/IPv6 because no one is passing knowledge around.

Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by 1_player on Friday June 28, 2019 @04:18PM (#20308446)
What new kernels? The three major OSes are two UNIX based, and one doing its own thing.

I don't think it's a great investment in time redesigning the whole socket API since you need to keep the old one around, unless you want to lose 35 years of source code compatibility.

The BSD socket API can definitely and easily be improved and redesigned, if only there was some new players in the field that wanted to drop POSIX and C compatibility and try something new.

Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by danarmak on Friday June 28, 2019 @04:30PM (#20308528)
> What new kernels? The three major OSes are two UNIX based, and one doing its own thing.

I meant that many new and forked UNIX-like kernels have been written over the past 35 years. Just the successful ones (for their time) include at least three BSDs, OSX, several commercial UNIXes (AIX, IRIX, Solaris, UnixWare...), and many others I'm unfamiliar with (e.g. embedded ones).

It's common to add new and better APIs while keeping old ones for compatibility. Sockets are a userland API, so if everyone had adopted a different one 20 years ago, the original API could probably be implemented in a userland shim with only a small performance hit.

However, a new file-based paradigm from sockets would probably work better with kernel involvement; that's why I mentioned kernels. We've seen many experiments in pretty much every other important API straddling kernel and userland. IPC, device management, filesystems, async/concurrent IO, you name it. Some succeeded, others failed. Why are there no widely successful, file-based alternatives to BSD sockets? The only one I know firsthand is /dev/tcp and that's a Bash internal.

Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by pjmlp on Friday June 28, 2019 @02:06PM (#20307158)
Except the part that BSD is one of the surviving UNIXes.
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by darkpuma on Friday June 28, 2019 @06:32PM (#20309332)
Which should drive home the point that "everything is a file" does not accurately describe the reality of the Unix "philosophy".
Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by DonHopkins on Saturday June 29, 2019 @04:16AM (#20311426)
If none of the Unix shells are remotely compliant with the "Unix Philosophy", then what is the "Unix Philosophy" other than inaccurate after the fact rationalization and bullshit?

Name one shell that's "Unix Philosophy Compliant". To the extent that they do comply to the "Unix Philosophy" by omitting crucial features like floating point and practical string manipulation, they actually SUFFER and INTRODUCE unnecessary complexity and enormous overhead.

Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by darkpuma on Saturday June 29, 2019 @08:41AM (#20312255)
> "If none of the Unix shells are remotely compliant with the "Unix Philosophy", then what is the "Unix Philosophy" other than inaccurate after the fact rationalization and bullshit?"

Precisely that! It's post-hoc rationalization and bullshit, that's the point I was driving at.

Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by 1_player on Friday June 28, 2019 @04:09PM (#20308369)
Nothing is ever "pure". Linux isn't pure, ultimate Unix philosophy.

ioctl, mmap, sockets could be represented as files, why not?

`echo 1 > /root/some-file/%lock` instead of fcntl(F_SETLK) -- I just made up this syntax

`echo SIGTERM > /proc/15683/signal` instead of kill

Not sure about mmap, since its very purpose it to map a file to memory.

Re:Red Hat Expecting X.org to “Go into Hard Maintenance Mode... by DonHopkins on Friday June 28, 2019 @04:43PM (#20308642)
>ioctl, mmap, sockets could be represented as files, why not?

The fact that they're not may be a clue to answering that question.