
Darling – macOS Translation Layer for Linux - pcr910303
https://www.darlinghq.org
======
linguae
What would be amazing is if Darling could join forces with the long-running
GNUstep project in order to provide access to the Cocoa APIs. This would
provide a means to run Cocoa apps on Linux, which will make Linux a more
attractive operating system for prospective Mac converts and may also increase
the popularity of GNUstep. Also, with many Mac users expressing anxieties
about the future of the Mac given Apple's business decisions under Tim Cook, a
combination of Darling and GNUstep would provide Mac users an option to still
use the apps they have invested in, just in case Apple neglects the Mac or
makes radical decisions that would negatively impact Mac users.

However, the last time I looked into this matter, GNUstep still has quite a
way to catch up to macOS Mojave's version of Cocoa. At the risk of going off
topic, I still don't understand why GNUstep never seemed to have reached
critical mass despite all these years of development. I was just a kid during
the mid-1990s, but KDE and GNOME took off around this time while GNUstep kept
pressing on. Here's my thoughts: maybe in 1995 and 1996 the OpenStep API might
not have been attractive to developers in a world where Windows completely
dominated the desktop, but this doesn't explain the decision of the KDE
developers to use Qt instead of GNUstep (as well as the decision of the GNOME
developers to use GTK+). There may have also been much uncertainty in 1997
following Apple's purchase of NeXT about the future of OpenStep. Such
anxieties would be alleviated sometime during 2001-2003 when Mac OS X was
released and started gaining popularity, but by then KDE and GNOME (and their
respective underlying GUI toolkits) were firmly established in the Linux
desktop ecosystem, and to this day they remain the dominant Linux desktops,
and many less popular desktops still rely on Qt or GTK.

~~~
sjwright
The problem with replacing MacOS is that its key value lies in aspects that
the open source community have yet to succeed in, or are structurally unfit to
succeed in.[0][1]

— System-wide UI consistency, especially in the fine details

— Singular UI/UX vision eliminates points of confusion and everything-is-a-
compromise choices for third party developers

— Navigable by non-experts, even when things turn to shit

— Nominally "perfect" hardware support

— Robust colorimetry

— Millisecond audio latency

I use Linux extensively, but I'm not aching to leave macOS as my primary
platform. Yes, they did start to go a bit loopy and off-track around Mac OS X
10.7–10.9, but from my vantage point it has been all uphill again since
Mavericks.

The idea of running Mac apps in a Wine-like compatibility layer sounds worse
than anything Apple could ever do to macOS. Yes, I like free. And yes, I like
personal choice. But I value my time and I'm sorry to proponents of other
platforms, but macOS just values my time more than any other platform.

________

[0] The achilles heel of the open source community stems from the lack of a
unifying vision and a top-down approach. This has major advantages as well as
major disadvantages. But nonetheless it affects the result. And depending on
your priorities, the advantages might outweigh the disadvantages or vice
versa.

[1] And to be fair it's equally true in the opposite direction. Open source
succeeds in many aspects like robustness, hardware compatibility, longevity
and transparency/deep trust. Hence why it has utterly destroyed the server
market. These areas of success are not accidental or arbitrary.

~~~
microcolonel
> _— System-wide UI consistency, especially in the fine details_

> _— Singular UI /UX vision eliminates points of confusion and everything-is-
> a-compromise choices for third party developers_

I mean, first-party GNOME applications are as consistent as first-party Apple
macOS applications; and third-party macOS applications are as highly
customized as third-party applications one might run on GNOME. Not sure what
you base your experience on but this is not really any more of an issue for
those looking for consistency over all else.

> _— Properly accessible by non-experts, even when things turn to shit_

I'd like an example, not really sure what you're talking about here. In my
experience, when things go wrong on macOS, you're prettymuch SOL until the
broken feature is either fixed, reimplemented, or removed in a subsequent
major release of the operating system. In my experience, Apple doesn't respond
to bug reports any more than other desktop OS vendors, including open source
ones.

> _— Nominally "perfect" hardware support_

The graphics drivers on macOS are very poor. Apple's decision to neglect and
then subsequently abandon OpenGL is pure laziness, and their implementation
was already bad when they were still maintaining it. Furthermore, hardware
compatibility with random gizmos on macOS leaves a lot to be desired in
comparison to Linux, in my experience, though I guess your mileage may vary.

> _— Robust colorimetry_

colord works just fine for me, no amount of software is going to profile your
monitors for you though.

> _— Millisecond audio latency_

I'm pretty sure CoreAudio frames are not less than 44 samples.

What I will give Apple credit for is a great set of graphics manipulation
libraries which make it simple to use high quality scaling and manipulation
algorithms, and making sure it's a conscious choice to use cheaper, faster
ones, and their implementation of seamless suspend-to-disk with full disk
encryption is admirable (though honestly, dispensable at the end of the day).
Their shaping and font rendering libraries are almost as good as Harfbuzz and
FreeType 2 (though I think they've just started using FreeType at least on
some platforms). Accessibility features are also pretty good, and depending on
what disability you have, it's a tossup between GNOME and macOS.

~~~
setpatchaddress
CoreAudio round trip latency can be under 5ms.

~~~
sjwright
And maybe you can get something comparable on Linux. Maybe? Do I have to think
about which distro I use? Do I have to think about which audio hardware I use?
Do I have to think about which audio apps I use?

On Mac, you get that insane latency without having to put a moment's thought
into any part of your architecture. I get that insane latency even if I never
bothered to learn why latency matters.

"Just works" is more than ease of use. It's productivity. It shows respect to
your mental load and mental priorities. And it is worth money to anyone whose
time is valuable.

~~~
mmjaa
Ubuntu Studio just works.

------
ncmncm
The main attraction of Apple products is the certainty that, no matter what
you do, they cannot be made to do what you would like. The consequence is that
you feel no urge to spend time tinkering to get there, and instead adapt
yourself to what it actually does. This reclaims all the time and attention
that you would have spent on tinkering.

Since what Apple products do has proven adequate for a large number of people,
and you are no less adaptable than they are, you know you can adapt, too.

Having once chosen to adapt to what Apple has chosen to offer, you find it
easier each time, until it becomes wholly unconscious. Each time Apple takes
away something you had used, you might momentarily balk at the "upgrade", but
always acquiesce in the end.

[Edit] So, the appeal of Mac emulation is very limited, because it starts out
with tinkering.

~~~
headsoup
I disagree entirely with that. I think Apple sold people the idea that what
they provide is really cool and 'just works' and that you want to be in their
'ecosystem.' It worked, people bought the allure and then just stopped looking
at other solutions because Apple said they don't need to.

I think your post highlights exactly that: a buy-in to the brand so strong as
to not even try and look elsewhere when issues arise, just adapt and accept.

~~~
welly
Do you really believe that? That people are so incapable of independent
thought that they will subservantly obey the wishes and demands of Apple?

Come on.

~~~
welly
ps. I used to have an iPhone, now I have an Android phone.

------
peter_d_sherman
Something like this is sorely needed by the open-source, not-for-profit,
shoestring-resources, cross-platform development community...

For example, let's say that I'm writing some cross-platform open source
software. And let's say that I am developing this software on a Windows or
Linux Box.

Now, let's say that for whatever reason, I don't have and can't afford a Mac
(a scenario like this is more common than you would think, especially in
developing countries...)

OK, so now how do I compile/run/test the Mac version of my software -- without
having that Mac?

?

That's why your software is so important.

Anyway, if you can get this fully operational (GUI and everything), you'll
solve that problem for that group of software developers...

If you're successful, if you prevail... Apple shouldn't sue you... they should
help you, because _additional software for their platform ultimately benefits
their platform_.

Also, judging by the source, you've done an amazing amount of work so far... I
hope you can find the additional developers/contributors you need to take this
thing to completion...

~~~
MuffinFlavored
> Now, let's say that for whatever reason, I don't have and can't afford a
> Mac.

Rely on some developer(s) spend 10,000 hours of their time for free developing
a Mac emulation layer, or go on eBay and buy a $600 used Mac to test on...

~~~
macdice
Or use one of the CI providers that will test your stuff on macOS (alongside
Windows, FreeBSD, ...). Possibly for free, if your stuff is open source. I use
that for Windows, which I don't personally use at all, and it finds bugs and
problems all the time. I wish someone would provide free (!) CI for some rarer
OSes and CPU architectures too, but I can dream.

~~~
viraptor
You can't fully test things this way. Not enough to make a serious release
anyway. You can easily pass all tests while not being able to even start the
app. You need at least one person with the real hardware to do testing.

~~~
saagarjha
This really depends on the tests you're running.

~~~
viraptor
True. But in context of: "tests in a CI environment which costs you less than
a MacBook", I don't believe anyone would go to the level that avoids those
issues. It would take a lot of work and resources to replicate a "real run in
clean, real environment".

~~~
saagarjha
Again, this depends on the tests you’re running and how you’ve set up your CI
environment.

------
lostgame
I wish I had the time to contribute to this. Getting Logic running on linux
would let me ditch the Apple hardware.

It's usefulness is entirely limited to the implementation of the core library
frameworks such as Core Image, Audio, MIDI, Animation, Data, etc...which will
be very, very difficult, I think, while maintaining FOSS status.

~~~
swiley
Linux audio latency really isn't great, having another layer in between your
app and the kernel probably won't help.

~~~
Sangeppato
It's actually quite good, or at the least it's better than Windows 10 on the
same hardware for me, even if using wine (Apple is still the best here
obviously)

------
niahmiah
This extra layer (and wine) are always going to be garbage.

If you need Mac or Windows, your best bet is not to move to Linux in the first
place.

If you do mostly development or scientific computing, then you’ve probably
dealt with more pain on those platforms, that melts away on Linux.

Best tool for job wins.

------
AntiRush
Maloader[0] is a similar (smaller, easier to understand) project that runs in
userland. It's a nice code base to read and there's this nice presentation
about it[1].

[0] [https://github.com/shinh/maloader](https://github.com/shinh/maloader) [1]
[http://shinh.skr.jp/slide/ldmac/000.html](http://shinh.skr.jp/slide/ldmac/000.html)

------
beardedwizard
I'm puzzled, wont most console apps already cross compile without much
modification? Isn't this basis of brew/etc? The GUI piece seems like the key,
but without it I'm failing to understand why this is significant.

~~~
theonemind
It says that it "does not yet" run GUI applications, so it seems like they
plan on it. Additionally, if no one ever talked about software like this
before completion, they'd have a pretty hard time getting enough developers
interested to ever reach completion.

As for making the front-page of HN, the HN crowd probably consists
disproportionately of technology enthusiasts who find interest in technology
beyond its immediate usefulness.

------
finchisko
I wonder where humanity would be, if people (including me) instead of arguing
on forums, actually did something useful :)

Like Darling could be already polished product.

------
tempodox
> At this point, does not yet run macOS application with a GUI

Which makes it rather pointless, for now. Practically all non-GUI software
that runs on Darwin can be made to run on Linux too and thereby even Cygwin.
What I would much rather see is library support for some BSD standard
functions that are missing from Linux. Trying to migrate software that uses
funopen(3) to Linux gives me an ulcer.

------
volgar1x
Will this enable Linux servers to build iOS apps?

~~~
klohto
How is iOS and macOS the same thing? It's not even running on the same
architecture.

~~~
panpanna
He means running xcode to produce iOS binaries

~~~
klohto
Then that's different. This won't work, xcode is heavily integrated with macOS
only libraries and as far as I'm aware, it requires GUI interaction at some
point to produce the iOS binary.

------
jamesu
Been experimenting using this to run legacy software and while it seems to
work great with command line tools, as soon as you progress onto gui stuff you
quickly run into missing functions and libs.

Still insanely cool though.

~~~
dehrmann
Especially for MacOs, where you can expect apps to stop working after a new
new major OS versions, this is really nice. Meanwhile, Microsoft maintains an
amazing degree of compatibility. I haven't tried, but I have a feeling Office
97 works in Windows 10.

~~~
earenndil
Traditionally, that was the case, but recently older applications have been
breaking in recent versions of windows. And windows and macos both have hacks
in place to fix older versions of popular applications (ms office, adobe
suite, etc.).

~~~
Wowfunhappy
While Windows's backwards compatibility is sadly getting worse, it's also
still pretty incredible. I can run lots of obscure Windows programs that 2+
decades old!

Mac backwards compatibility isn't as bad as some people say—I have a decade-
old program that still works in Mojave, for instance—but Windows is a lot
better.

The platform with _awful_ backwards compatibility is iOS. And there, you don't
even have the option to dual boot or downgrade. The fact that no one cares
says something about how much we value mobile software...

~~~
earenndil
Honestly, the only time ios has broken backwards compatibility is with 32->64
bit. And—not to minimize that, that is quite major, but that's pretty much the
only time it's happened.

~~~
Wowfunhappy
Have you ever actually tried to run early iOS apps on iOS 10?

I have. I had an iPod Touch for a couple of years as a teenager, but then left
iOS until I got an iPhone in college. Once I had the iPhone, I decided to go
through my purchase history and re-download the apps I'd used on my iPod, for
nostalgia's sake if nothing else.

To my dismay, _exceedingly_ few of the old apps worked, and most of those that
did had major graphical glitches. (Not including apps which had been updated
by the developer more recently, of course.)

~~~
earenndil
> To my dismay, exceedingly few of the old apps worked, and most of those that
> did had major graphical glitches

Link them to me and I'll try them out. I've never had that experience.

~~~
Wowfunhappy
I took a look, and it seems like a lot of them were removed from the App
Store. If you happen to have any of these in your purchase history:

* Convertbot

* Tap Tap Revenge Classic / 2.5 / Dance

* Roland 2

There were definitely way more, but I don't remember which ones, and now that
I'm on iOS 12 I can't test any of them (all 32 bit). These are the three I
specifically remember not working.

~~~
earenndil
Hmm, those seem to be gone and I never downloaded them before.

Hah, guess the reason I've never noticed any compat issues is they removed the
apps they broke compat with.

------
mikemoka
for reference a link to the previous conversation is here:

[https://news.ycombinator.com/item?id=12854895](https://news.ycombinator.com/item?id=12854895)

------
IOT_Apprentice
The comments here sound like they are from Android users who go on about how
great Android is because they can spend hours tweaking their phones and
rooting them and side loading them. LOL. "made to do what you like". Dudes,
just get Windows 10 and install WSL and tweak away.

------
iLemming
I really want something like Hammerspoon, but for Linux

~~~
yacoob
Surely there's something equivalent...?

I've used Linux on desktop exclusively ~95-07. Switched to MacOS after that.
Tried out mythical "Linux on the desktop" in 2018, was amused to find that
iTerm2 has grown so much, and there's hard to find a good replacement for it
under Linux. Of all the things I'd expect it to handle well... 8)

~~~
ktpsns
One of the most sophisticated Linux terminal emulators I worked with is
Konsole, the KDE terminal. However, I never worked long enought with iTerm2 to
learn all the features. My feeling is that there is a growing crowd of
Linuxers who go for "minimalism", like tiling WMs and minimal terminal
emulators, and using tools like tmux or zsh to streamline their experience.

Regarding Hammerspoon (which reminds me very much on what you can do with
AppleScript), you certainly can do many of the examples
([https://www.hammerspoon.org/go/#spoons](https://www.hammerspoon.org/go/#spoons))
with modern-day frameworks like xdg, dbus, libevent, inotify. My feeling is
that (for instance) Python PIP has pretty comprehensive libraries which allows
you to use it as a glue language for all that interfaces. I would not be
surprised if that even feels slimmer and more powerful then Lua in the end,
but it's a matter of taste. As always.

