Live data from Hacker News

Posix Has Become Outdated (2016) [pdf]

cs.columbia.edu

171–180 of 246 posts

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

#171
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 -…

Apparently you forgot to read the part where I mentioned "Languages like Python?".

    import glob
    import shutil
     
    whitelist =  set(open('Whitelist').read().split())
    for fd in [ x for x in glob.glob('mydir/*', recursive=True) if x in whitelist]:
       shutil.copy(fd, 'OUTPUT')

Better, no need to create temporary files.

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

#172
post #30

Earlier quoted context omitted.

Where are the C++ killer applications on iOS and Android, besides game engines, written 100% in C++? Where is C++ on the iOS and Android documentation versus Objective-C, Swift and Java?

100 % is a trap. Lots of games that require performance use c++ heavily. There's an NDK for a reason. There's a lot of languages and many are used in different contexts. Just because people use Java and C# to write desktop apps doesn't mean a lot are not using c++ and Qt to do the same.

The NDK doesn't expose Android frameworks other than via JNI, games do their UI via OpenGL and use very little features from Android itself.

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

#173
post #166
post #159

Earlier quoted context omitted.

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…

it sounded like he was saying that POSIX compliance was more likely in "modern" applications

Yes. Part of this is because more operating systems are approaching POSIX-compliance; but the number of patches we need to port random Linux code to run on FreeBSD has dropped tremendously over the past 20 years.

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

#174

Earlier quoted context omitted.

Look at the design of NT. Every output is based on IPC and calls to the event logger. That something like a stdout exists is due to backwards compatibility and mostly the Posix subsystem. The entire OS was meant to be used and administrated by means of GUI. The existence of a bunch of CLI tools that deviate from the main paradigm doesn't prove anything to the contrary. Have a look at the literature on the design and…

>"Every output is based on IPC and calls to the event logger." What does that even mean? I think you're painting an incorrect picture of the design goals of NT. The original NT was designed by a group of people (e.g. Cutler) with VMS background and they sure as hell didn't have any GUI in mind. In fact, Windows came to the picture much later. Whether NT is administered by a GUI or CLI is totally irrelevant to NT desi…

To be fair, original Windows API didn't have any concept of stdin/out/err. In win16 days most development environments had something like that but it was emulated inside compiler vendor supplied runtime libraries. CLI as first class OS APIs come from NT.

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

#175

Earlier quoted context omitted.

Look at the design of NT. Every output is based on IPC and calls to the event logger. That something like a stdout exists is due to backwards compatibility and mostly the Posix subsystem. The entire OS was meant to be used and administrated by means of GUI. The existence of a bunch of CLI tools that deviate from the main paradigm doesn't prove anything to the contrary. Have a look at the literature on the design and…

>"Every output is based on IPC and calls to the event logger." What does that even mean? I think you're painting an incorrect picture of the design goals of NT. The original NT was designed by a group of people (e.g. Cutler) with VMS background and they sure as hell didn't have any GUI in mind. In fact, Windows came to the picture much later. Whether NT is administered by a GUI or CLI is totally irrelevant to NT desi…

[deleted]

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

#176
Yes as usual everything the world is built on top of is totally wrong. POSIX, C++, any conservative principle, any majority race or sexuality etc.

It's easy to criticize everything endlessly, much more challenging to make things better without tossing out the babies with the bathwater.

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

#177

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 mechan…

I don't know QNX, but for IPC you should also take a good look at the L4 microkernel IPCs. It might be what you describe here. The point is that they are fast. Nearly function-call-speed.

The should probably a more complex IPC layer on top or beside it. Something like DBus with schemas, names, groups, broadcasts, etc because otherwise people will reinvent it poorly.

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

#178

I know people tend to hold up POSIX compliance as something that's of utmost importance, but from my conversations with Bionic's maintainers, there's an awful lot of cruft and poor designs in some of the POSIX APIs.

I don't know enough about the POSIX APIs to comment with any authority on that, but I certainly wouldn't be surprised if a long running software project that has been required to stay largely backwards compatible as it evolved has become crufty. However, the importance of POSIX isn't really to do with specific design details, but rather because it aids in software portability. This is still a desirable trait. In othe…

I can tell you right off the bat that POSIX might be better than no "standard" at all, but porting stuff between any POSIX-ish OS still means an actual port.

Practically every non-trivial POSIX-ish program is not portable. This also includes quite some supposedly higher level applications written using things like Java, Go, Ruby, Python ... since they all leak POSIX details all over the place and make non-portable use quite easy.

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

#179
post #177

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 mechan…

I don't know QNX, but for IPC you should also take a good look at the L4 microkernel IPCs. It might be what you describe here. The point is that they are fast. Nearly function-call-speed. The should probably a more complex IPC layer on top or beside it. Something like DBus with schemas, names, groups, broadcasts, etc because otherwise people will reinvent it poorly.

The big question with IPC is what problem you are trying to solve. For microkernels you want blazingly fast cross-process function calls, but IPC mecanism that can do only that is mostly useless for Unix userspace. For example all of QNX style IPC, traditional SysV-style unix IPC and pthreads have no API for select()-on-IPC-primitive (VMS and Symbian have that and NT has mechanism for this that mostly works)

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

#180

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 mechan…

I would wish that the whole (disk) I/O mess would be cleaned up. It's just laughable how broken that is across operating systems. And it's supposed to be the back-bone of most operating systems as well.

Also, memory management. Only in very recent years proprietary APIs surfaced in Linux and friends that allow to leverage some of a modern MMUs capabilities (which is good). Meanwhile we still have stupid MM semantics like fixed / non-reversible allocation commits.

> The database people would love to have well-defined semantics like this.

Yes. Yes they would.

Right now there is no way in no operating system to actually do asynchronous disk IO. You can do an equivalent of write(2) asynchronously, at least on Linux, Windows and I think SunOS, but in all of them it's not really asynchronous; they will run extent allocation synchronously which can -worst case- mean multiple disk read/write cycles. This of course means that for many applications that could make use of async write actually need to use threads and queues for doing it.

Post reply on HN