Live data from Hacker News

Posix Has Become Outdated (2016) [pdf]

cs.columbia.edu

161–170 of 246 posts

Re: Posix Has Become Outdated (2016) [pdf]

#161
post #82

Earlier quoted context omitted.

Well, for starters there are every Windows NT system you have ever used, which uses ACLs quite successfully and extensively for a whole host of reasons, and ... me. I put ACLs to good use myself. Your wording, speaking of repositories and git, bespeaks a too-narrow idea of what ACLs can be used for. Aside from all of the examples that one can glean from Windows NT, from window stations to the trusted installer, there…

What's your own use case? Do you have a good source of example use cases for ACLs in Windows NT?

Our business uses them to restrict portions of our shared drive to certain groups. They're also used to restrict programmatic access to system folders, by Windows.

Re: Posix Has Become Outdated (2016) [pdf]

#162
post #126

Earlier quoted context omitted.

Are you also speaking about all those APIs in GNU/Linux that aren't part of any other UNIX clone?

You're confusing things. You don't break a standard when you write a function or even a whole library.

So Microsoft, Google and Apple do it, it is bad.

Linux does it, it is me that doesn't understand, I see.

Re: Posix Has Become Outdated (2016) [pdf]

#163
Reasonable enough. The article focuses on client-side programs, especially Android, which have somewhat different requirements than the Posix model envisions. Most of the things you need to do on headless servers can be done through the Posix model.

The big weaknesses in Posix they point out are in interprocess communication and parallelism. Both were afterthoughts in UNIX. UNIX/Linux land never had a good IPC mechanism. (As a former QNX user, I've seen this done right; check out MsgSend/MsgRecv there.) Posix thread-level locking primitives tend to be too slow, but that's partly a hardware support problem. Async I/O now seems to be popular; networks are so slow on mobile, and servers have scaled to the point that dispatching overhead for all the running threads gets to be a problem.

Yes, Posix doesn't do graphics. That's good; if it had a window API, everybody would be complaining about it. Look at the KDE/Gnome wars, or the OpenGL/Direct-X wars.

Here's what I'd change in Posix.

On the file system front, I occasionally argue that UNIX/Linux/Posix file system semantics should be slightly different. There should be several types of files. "Unit files", the normal case, can only be changed in their entirety. Opening a unit file for writing should create a new file, and on successful close (not program exit, abort, or system crash) the new version replaces the old version for future opens. Today, you still have to jump through hoops to do atomic file replace, and the hoops are different for different OSs. Posix doesn't address this. This is something that should Just Work as the default file semantics.

"Log files" should just extend. This is what opening for append should do. You can't go back and overwrite. On an abort or system crash, the end of the file should be at the end of some recent write, and correct out to the last byte of the file length. Logging may be behind after a crash, but should never trail off into garbage.

"Managed files" are for databases. You would get two async I/O completions - one when the OS has accepted the write, and one when it's safely committed to disk/flash. Rather than flushing, database programs would usually wait for the commit completion. This would be a special mode asked for with an "ioctl" call, used only by the few programs that really care about database recovery. The database people would love to have well-defined semantics like this.

"Temp" files (in /tmp or some designated directory) would have only the guarantee that after a crash, they're gone.

On the interprocess communication front, I'd copy MsgSend, MsgRecv, and MsgReply from QNX. That's subroutine-call type IPC; send a message and wait for a reply back. This is what you usually want for multi-process programs. Connection setup could be improved over QNX; the mechanism for finding the receive port in another process needs to be improved and there should be at least one well-known port number (like stdin/stdout/stderr are 0,1, and 2) that each process uses first. This needs to be integrated with the CPU dispatcher, as it is in QNX, so that when you do a MsgSend, the sending thread blocks and the receiving thread unblocks without going through the scheduler. Otherwise, you go to the back of the line for the CPU on each interprocess call.

Re: Posix Has Become Outdated (2016) [pdf]

#164
post #62

Earlier quoted context omitted.

GUI tooling? Languages like Python?

How would you do this with GUI tooling: Find all files containing a particular string in a directory tree. For each of those files, if its filename appears in a file called Whitelist, write it to a file called Output. Otherwise, do nothing. Here is one possible command line version (I haven't tested it as I'm on mobile): TMPF=`mktemp /tmp/XXXXXXXX` && ag MyString | awk -F: '{print $1}' | sort | uniq > $TMPF && comm -…

Would be trivial to write a GUI program to do the same.

Re: Posix Has Become Outdated (2016) [pdf]

#165
post #158
post #120

Earlier quoted context omitted.

sendmail is dead at this point though.

How so? As recently as 2015, sendmail, Microsoft Exchange Server, Postfix, and Exim together represented over 90% of SMTP service. Or is this one of those pre-emptive "called it first!" kind of comments?

I think the point is that out of these 90% not so many ones are "sendmail" anymore.

Re: Posix Has Become Outdated (2016) [pdf]

#166
post #159
post #157

Earlier quoted context omitted.

I don't know what you're referring to with that distinction. AFAICT they weren't testing for POSIX compliance but rather where the POSIX layer was being used in practice, which statistically was by system-level frameworks rather than the applications themselves on the OSes they tested. The notable change between now and 25 years ago is that the POSIX layer tends to be used at the lower levels of system frameworks, wh…

I'm a little confused by the distinction. For example, if I use a framework that abstracts away pthreads from me, but still uses pthreads in its implementation of threading, is the application I write still POSIX-compliant?

No, the application would not be POSIX-compliant, but it would be running on a POSIX-compliant OS. I was confused by the comment I replied to because it sounded like he was saying that POSIX compliance was more likely in "modern" applications, but if anything the opposite is the case.

POSIX compliance is much more common in consumer OSes nowadays, to the point that every major desktop and mobile platform is built on a POSIX-compliant kernel and runtime except for Microsoft's offerings. In that sense POSIX has taken over the non-Microsoft world, but now it's being used as a much lower-level compatibility layer for system-level frameworks rather than what it was originally designed for.

Even Windows has had multiple POSIX implementations over the years, they were just built as compatibility layers on top of the native APIs. So POSIX-compliant operating systems are almost universal at this point, but POSIX-compliant applications/daemons/etc. (all the programs that run on those POSIX OSes) are rarer than ever.

Re: Posix Has Become Outdated (2016) [pdf]

#167

Earlier quoted context omitted.

How would you do this with GUI tooling: Find all files containing a particular string in a directory tree. For each of those files, if its filename appears in a file called Whitelist, write it to a file called Output. Otherwise, do nothing. Here is one possible command line version (I haven't tested it as I'm on mobile): TMPF=`mktemp /tmp/XXXXXXXX` && ag MyString | awk -F: '{print $1}' | sort | uniq > $TMPF && comm -…

Would be trivial to write a GUI program to do the same.

I think it would take at least a half hour, unless you have directory traversal, file I/O, and regex APIs memorized which most people don't. That's "trivial" in the grand scheme of things but it's really not practical to do day-in and day-out every time some random scripting necessity arises.

And you presumably have to clutter up your filesystem with random project files, etc, which is annoying. Are you going to have 1000 of these, one for every time you need to do some sort of minor task like this?

That command, on the other hand, took me 2 or 3 minutes to write, and I had to look up the syntax for `mktemp`. If I had remembered the mktemp syntax it would have taken a few seconds.

Re: Posix Has Become Outdated (2016) [pdf]

#168

Earlier quoted context omitted.

Let me paint this in a more interesting colour: at $work, most of our development work is very POSIX-y software (it only runs on Linux, but historically, at least portions of it used to run on a bunch of BSDs, too, and they probably still do, but no one tried it in years). Almost no one in the office uses Unix on their computer, not even those of us who use Linux at home. Most of us have Windows stations. We can inst…

I used to run Linux at my previous $workplace, but I definitely lost more time than my employer would be comfortable knowing disentangling things that regularly broke after updates Sounds like you were upgrading too often (almost sure, if you were already dealing with systemd). Windows releases a new version only every 3-4 years, there's no reason to update your Linux workstations any faster. At my work, we're still…

Sadly, the choice wasn't quite mine to make, so I had to follow the regular Ubuntu releases. What can I say, I looked at non-LTS releases and looked and looked but didn't see the beta marking and I thought they were actually production-ready...

I used to run Debian stable at home a while ago and did like the stability, but the security update situation is not exactly something I'm happy with.

Re: Posix Has Become Outdated (2016) [pdf]

#169
post #32

Earlier quoted context omitted.

That's what majority of computer users (smartphones included) use though. As for developer-oriented CLI tools, I've also seen more and more GNU-isms and macOS-isms creeping in.

Just curious, can you give me some examples of GNU-isms/macOS-isms? I have a suspicion what they might be, but I'm not sure.

dispatch and XPC are very popular macOS APIs that are "POSIX level". At least one of those is open source.

Re: Posix Has Become Outdated (2016) [pdf]

#170
post #161

Earlier quoted context omitted.

What's your own use case? Do you have a good source of example use cases for ACLs in Windows NT?

Our business uses them to restrict portions of our shared drive to certain groups. They're also used to restrict programmatic access to system folders, by Windows.

And it's not possible to use conventional Unix groups for that?
Post reply on HN