Edit: OK why downvotes? Did I say something that is not true? Matter of taste, but seems like it's new trend to hate on Apple computers. Its cool now right? Why can't people just move on...
Edit2: Forgot that this is HN and that every word is meant literally. ¯\_(ツ)_/¯
Lots of people will stick with Apple hardware or the mac operating system I'm sure, but I do agree that I think a lot of people will cross over once some of these barriers are removed.
Anyway back to the story, I think that number of people that use Macs only for iOS dev is existent but not really that big. Except platform specific development (like .NET/Windows, or iOS/macOS for that matter), most of development is pretty platform agnostic (where you draw the line here is UNIX-like vs Windows OS). App developers will have to stick to Macs, unless Apple go totally insane and release dev tools for iOS on Linux (which won't happen in my opinion, because of the anatomy of both macOS and Linux). So OPs comment doesn't make sense from the beginning (both technically and economically for Apple).
The subsystem that was made just to claim POSIX compatibility was the subsystem that preceded Interix. Interix was developed outwith Microsoft, and replaced the old POSIX subsystem. It was Windows NT's second POSIX subsystem, and it very much is not just a sop for the sake of checking a requirements checkbox.
It's a fairly usable POSIX environment, with a large toolset, proper terminal emulations, pseudo-terminals, interoperability with non-POSIX processes including visibility with (an enhanced) ps and the ability to send signals to Win32 processes, an actual init and inetd, and an X server.
Stephen Walli has stated that it started as a fork of 4.4BSD-Lite.
Could you elaborate on how you run GUI apps? Is it through some Xorg compiled for Windows? Can you use hardware-assisted OpenGL from WSL?
So I'm wondering how much of the software requires 'Linux' per se or rather just relies on a GNUserspace such as Ubuntu.
It might be an interesting test case of WSL compatibility for Canonical/MS programmers to get this working. (although wasn't MS working on some sort of iOS bridge for WP10, in the case of Darwin-based programs?)
And who in the hell ever developed for it anyway? That was a niche, forgotten product if there ever was one.
edit: maybe you should keep up with stuff more if you're going to defend it so much, it was deprecated like 7 years ago
This is an untrue generalization. I know people who have a Mac, yet do all of their actual coding within containers set up to use some flavor of Linux and never really touch the underlying OS. Macs DO have solid, reliable hardware underneath, but the insinuation that there is no reason you need to run a true POSIX compliant OS vs MacOS is definitely not a hard and fast truth.
http://stackoverflow.com/questions/5785516/is-osx-a-posix-os
https://en.wikipedia.org/wiki/Single_UNIX_Specification
Presence of bugs does not preclude you from being compliant to the spec.
...also... Linux is not officially compliant to either one.
The fact is, Darwin gives me trouble a lot more than Linux does when using POSIX APIs. If there were a comprehensive, up to date POSIX test suite, Darwin would fail it.
1) That's a nearly 15-year-old standard (03 == 2003). Windows was certified to the predecessor POSIX standard.
2) While certified, it's compliance in actuality is poor. macOS's certified status says more about flaws in the certification test suite and administrative process, and the OpenGroup's need for income, than it does about macOS. The manual page for pselect, for example, even admits that it's not compliant!
FreeBSD, Linux, NetBSD, OpenBSD and probably DragonflyBSD are all more compliant in a practical sense than macOS, and much more compliant to the latest specification as they implement all or most of the newly defined interfaces, while macOS implements very few.
That said, yeah, macOS is compliant enough as a practical matter, especially compared to Windows. Porting stuff to macOS is about as painful as porting to Solaris or AIX, which is to say not very painful.
The biggest headaches with macOS are the bugs. For example, last week I was adding support for sendmsg/recvmsg and IP_PKTINFO in my Lua unix module and was able to reliably crash the kernel with a single line of unprivileged code:
https://www.irif.fr/~boutier/mac-crash.html
I was really confused at first. I had to reboot multiple times before I figured out it was my test code and not my hardware dying. After some Googling I found the above link that verified what I was seeing. This bug was only fixed, AFAIK, in macOS 10.12. (I don't have a 10.11 machine to test.) I was testing the code on 10.10, and as of the latest update a couple of days ago 10.10 is still broken AFAIK.The most famous problem was kqueue not supporting pipes, but that was fixed eons ago. There are alot of other problems with their neworking subsystem, though. For example, shutdown() fails if the associated stream has already entered the equivalent state, either because the sender sent RSET/FIN or shutdown was alreayd called; no other implementation does that. If you send a socket descriptor to another process with sendmsg and then immediately exit the process, the receiving process will receive an unuseable file descriptor. There are lots of stupid quirks like this that make writing reliable, high-availability software for macOS very difficult. Fortunately, few people use macOS for HA server stuff, but I like porting my software to other platforms because it helps catch bugs (bugs that, for w'eve reason, stay hidden when running on Linux), and macOS provides a poor signal/noise ratio in that regard.
Where does it say that? I'm running 10.12.1, and the man page for pselect(2) looks like the one from FreeBSD. I could believe that pselect doesn't actually behave as documented, having run into my share of macOS bugs.
> [...] Porting stuff to macOS is about as painful as porting to Solaris or AIX, which is to say not very painful [...] The biggest headaches with macOS are the bugs.
Agreed, though AFAIK all commercial UNIXes are buggy in one way or another, and I don't know if macOS is worse in comparison. Autoconf exists for a reason, even though few if any really like it.
IMPLEMENTATION NOTES
The pselect() function is implemented in the C library as a wrapper
around select().
That means it's not actually compliant. pselect needs to _atomically_ unblock signals so that if any signal handlers are invoked pselect returns EINTR error. User code can't emulate the correct semantics because there's a race between unblocking (i.e. changing the signal mask), checking for signal arrival, and calling select. It's _impossible_ to fix this race without resort to pselect, or by use of system extensions like kqueue on BSD/macOS[1] or signalfd on Linux, which can be tricky. On Solaris you just have to use pselect, or resort to the so-called "pipe trick".So the fact that pselect is a wrapper around select admits that it's not conformant. It's basically useless; worse, it's dangerous because application code calling pselect expecting there won't be a race.
You can see the race with this code, which on 10.10.5 still fails. What should happen is that it exits immediately with OK. What actually happens on macOS is that its pselect wrapper unblocks the signal, which is immediately delivered. But by then we've already checked that interrupted was still 0. It then calls select, which will timeout because it won't be interrupted--the signal was already delivered. On every other platform implementing pselect (which all do it correctly), pselect will always return EINTR because the signal unmasking and delivery happens in the kernel _after_ entering select.
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <sys/select.h>
#include <unistd.h>
#include <err.h>
static int interrupted;
static void
interrupt(int signo)
{
interrupted = signo;
}
int
main(void)
{
struct timespec timeout = { 3, 0 };
sigset_t empty, block;
int n;
sigemptyset(&empty);
sigemptyset(&block);
sigaddset(&block, SIGHUP);
sigprocmask(SIG_BLOCK, &block, NULL);
signal(SIGHUP, &interrupt);
raise(SIGHUP);
while (!interrupted) {
/*
* If pselect does not atomically unblock signals, pselect
* will never be interrupted and we'll lose the signal until
* something else wakes us up AND we remember to check even
* though we never saw EINTR.
*/
n = pselect(0, NULL, NULL, NULL, &timeout, &empty);
if (n == -1 && errno != EINTR) {
err(1, "pselect");
} else if (n == 0) {
errx(1, "timed out");
}
}
if (interrupted != SIGHUP)
errx(1, "wrong signal (got %d, expected %d)",
interrupted, SIGHUP);
puts("OK");
return 0;
}
[1] FWIW, here's a correct implementation of pselect for macOS using kqueue. (https://github.com/wahern/cqueues/blob/snap-20160812/src/cqu...) The only caveat is that creating a kqueue descriptor might fail, and you don't normally expect pselect to fail with EMFILE or ENFILE; it might even make it non-compliant. Except for that caveat, it's a compliant implementation of pselect AFAICT.Anyway, the man page for pselect(2) in 10.12.1 doesn't have that section, and when I run your test program it prints "OK". So it appears that this particular bug was fixed. It only took them 2 years (could be less if it was fixed in 10.11) this time, which was an improvement over their turnaround for fixing the rename(2) bug[0]. :-P
I wish more people subscribed to this - I've banged on about this at previous jobs with little success (even though I've demonstrably caught "mistaken assumption" and other bugs through the exercise.)
STANDARDS The pselect() function conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
But see my link in the other reply to a correct implementation I wrote that relies on kqueue. I even submitted it to Apple years ago along with the bug report.
It's just a matter of momentum... and Apple certainly has that in spades.
I did switch to using MacOS for several years... but am now back on Linux. It's just a better for development for me. But hey... Linux has been my primary workhorse since the 90s... so I am certainly biased. I did give the MacOS bandwagon a try though. :D
I never actually let it run down to 0. It's possible the last 10% would have vanished in 30 minutes instead of ~2 hours like it claimed.
I can certainly believe a Linux machine can get 14hrs. It's just a matter of having a bigger battery, and a processor that will step-down its speed when its not needed.
Citation needed. Some people like the mac UI sure, but there are people who hate it too. People who use a mac only because they have to to develop for iOS or OSX certainly do exist.
I got tired of it in about one year. Now the laptop, which I barely use (my desktop runs circles around it), is running a Linux distribution. More comfortable UI, comparably solid, (usually) seamless software upgrades and better management, more customizable, etc.
Not to mention across all company sites.
EDIT: And if you bother to listen to the Android Developers Backstage podcast, according to the Android team themselves the large majority is on Windows.