Live data from Hacker News

Darling – macOS Translation Layer for Linux

darlinghq.org

161–170 of 176 posts

Re: Darling – macOS Translation Layer for Linux

#161

Earlier quoted context omitted.

> 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.

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.

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.

Re: Darling – macOS Translation Layer for Linux

#162
post #119

Earlier quoted context omitted.

>I'm pretty sure CoreAudio frames are not less than 44 samples. CoreAudio is actually pretty good. Without the linux-rt patchset, jack pipelines do overrun even when running jack at 10ms. Linux has quite the latency spikes. It's possible to demonstrate this fairly quickly by running cyclictest from rt-tests.

> CoreAudio is actually pretty good. I wasn't arguing that, I was saying that "millisecond latency" involves frames smaller than (samplerate / 1000) samples, completely ignoring overhead. > Without the linux-rt patchset, jack pipelines do overrun even when running jack at 10ms. Linux has quite the latency spikes. Are we talking about sub-10ms latency? Sure, that's a different matter, and Linux's default schedulers co…

>Are we talking about sub-10ms latency?

Yes. Even for the audio case, having to run jack at 10ms is already a lot, particularly since Linux is not the only source of latency.

>Sure, that's a different matter, and Linux's default schedulers could stand to improve support for mixed-realtime.

Even SCHED_FIFO (where preemption is immediate, and cpu isn't released until the high priority program yields it itself) suffers from latency spikes; it is not a scheduler issue but an overall Linux design issue.

cyclictest from rt-tests will easily highlight that. Try leaving cyclictest --smp -p98 -m on the background. After a while, you'll notice the entirely unacceptable max latency readings. All the test does is set an alarm so that the task becomes runnable (which means it should run immediately due to SCHED_FIFO) and check the difference between the alarm and the current time.

Mainline kernel is effectively unusable for anything that requires low latencies such as audio work, as it spends too much time running non-preemptable code in supervisor mode. Linux-rt improves this situation radically, but the monolithic design simply isn't suitable for this; microkernel multiserver systems are a much better fit.

Incidentally, refer to seL4 for a system that has a guarantee in the form of a formal proof of worst case execution time.

Re: Darling – macOS Translation Layer for Linux

#163
post #73

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

What a bunch of nonsense.

Re: Darling – macOS Translation Layer for Linux

#164
post #158

Earlier quoted context omitted.

> > file history > You can have that in Linux You can use lvm or zfs snapshots, but that's not what I'm talking about – I'm talking about in-app browsable history of things like documents or presentations. > Krunner, for example, has all the same features as Spotlight Last I checked it used Baloo to do the actual indexing, the list of high priority features/bugs on the project site https://community.kde.org/Baloo ( B…

> You can use lvm or zfs snapshots, but that's not what I'm talking about – I'm talking about in-app browsable history of things like documents or presentations. I got that. It's still just some application UI wrapped around a CoW file system. Maybe a better way of saying your point is "doing the same on Linux lacks a lot of polish" - which is true. But that's when happens when Linux has to support a multitude of fil…

> It's still just some application UI wrapped around a CoW file system.

So? In terms of usability impact I still consider it a major feature (that no amount of tweaking will get you on Linux).

> My point is you shouldn't have to install a 3rd party package manager.

But macOS has a "package manager" – it's called App Store. You and I may not think it sufficient for our (developer) needs, but we're not representative users. And for normal users and even myself it offers very useful functionality over what they'd get out of the typical native linux package manger. You can trivially reinstall everything on a different machine with a different os version (as long as it's not super ancient), and it works – no "DLL" hell, because everything is essentially self-contained. And since software is tied to your account, there is no need for crufty apt queries in the hope to get a list of packages out you can backup for reinstall elsewhere or after clean upgrade. Ubuntu has tried to establish a clone in the Snap Store, but no one I know seems to use it and I haven't tried it myself, so I don't know how compelling it is.

And I need to install a 3rd party package manager on (non-NixOS) linux distros anyway, because IMO apt, yum etc. fundamentally suck and nix is the only thing that doesn't. Funnily enough, the only really compelling UX argument for linux instead of macOS for developers I can think of apart from /proc is that with NixOS you can codify your complete machine setup in a single nice config file, making it super easy to replicate, backup or inspect.

> Or maybe you're just exaggerating all these problems to make a point [...] More importantly Linux doesn't do what you're accusing it of doing.

It's a bit annoying to be told that what I'm saying literally can't be true. It is, and I didn't tweak any sysctl params or the swap setup before I got tired of my machine grinding to a halt and me having to reset it. I can ensure you it's entirely possible to have a high grade desktop with SSD and have linux fall over swapping endlessly without even being able to move the cursor anymore. Of course this doesn't happen in "everyday" usage otherwise no one would be running linux, but it's not that hard to trigger if you're running a VMs, a few browsers and dev tooling stuff that can potentially consume large amount of memory very quickly. I've moved away from having to use these tools (and also tweaked my machine) so it hasn't been a problem off late, but I ran into it with completely stock ubuntu.

Re: Darling – macOS Translation Layer for Linux

#165

Earlier quoted context omitted.

Woah there buddy. — Apple makes it extremely easy for anyone to start backing up their computer in a way that covers an array of scenarios from accidental or malicious deletions to full-on disaster recovery. — It has everything to do with MacOS because the creation of backups happens within a MacOS environment and the restoring of backups happens within a MacOS environment. The only "firmware" aspect is the (relative…

> If your plan is to recover data from a damaged device, you've failed before you begin. Apple says this is the case, but it's not actually the case. Repairing a device is how you recover data from it. I know it's preferable that people make an effort to protect their data, but in the real world, approximately zero people back up anything.

What I mean is that you've failed in principle. You shouldn't ever risk being in a position where access to your data may become contingent upon the skills of a repairer wielding a soldering iron. If maintaining comprehensive backups isn't boneheadedly simple and robust, your vendor is selling junk.

But as a practical matter I don't disagree. If you failed to maintain comprehensive backups (or you have suffered a rare double-disaster) then it's great that these hardware repair experts exist.

Re: Darling – macOS Translation Layer for Linux

#166
post #73

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

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

Amiga, Atari and other 8/16 bit platforms also did just work, it wasn't Apple selling the idea.

The IBM PC was the exception here, and it only grew thanks to the mistake of IBM not protecting their BIOS as they thought.

Re: Darling – macOS Translation Layer for Linux

#167
post #141

Earlier quoted context omitted.

> Better to just use Git. How would this help with my example? Git is terrible for managing non-text files and has zero support for browsing such files interactively. It also doesn't work at the file level and is pretty much unusable for anyone who isn't a developer. > Re. keybindings: you can change your default GTK bindings to Emacs-style if you want to. Yeah, but that doesn't really work, it just makes the whole m…

> Turning off overcommit (and swap) does improve responsiveness but is not a viable option for a desktop system Back when I got my first SSD I ran Linux without a swap file/partition. I did this partly because it was only a 60GB SSD so I wanted to conserve space. I also did it because I didn't want to shorten the life of the SSD with (this was back when such a thing was a concern) and I ran that set up for years on a…

> Back when I got my first SSD I ran Linux without a swap file/partition

You can turn off swap if you don't need hibernate, and from memory even turning off overcommit used to be OK-ish (of course most software written for linux doesn't try to deal with failing malloc requests gracefully, because there's no point since it never happens in the default configuration). You end up with a noticeably snappier system. However, this no longer seems to work in practice. Try turning off overcommit completely and see how long it takes Chrome to crash even if you have a lot of available memory.

> A far better approach is to have your indexer run as a separate process that monitors file writes (you can still have a kernel hook for that if you wish)

This is how spotlight works though, no? It's a separate process gets notified by the kernel on file system changes and then indexes them (that's what I meant with FS integration). I agree that you don't want to synchronously update all indexing meta info on FS operations because everything will grind to a halt if you do that. But you still want OS support such as reliable notification and extended FS attributes to store things like "this was downloaded from here" or tagging. I don't think there is anything particularly magical about this (spotlight is 15 years old tech and linux has had xattr support in all major file systems for ages) but in practice xattrs end up pretty much useless in linux because next to nothing uses them (baloo probably does) and as far as I'm aware there is no robust file system change notification API (you can use inotify for some stuff, but it's limited in various ways). I'd love to be wrong about this though.

I think the situation is better on macOS, but it might just be that spotlight is more polished and there is no fundamental difficulty in writing the same for linux these days.

Re: Darling – macOS Translation Layer for Linux

#168
post #167

Earlier quoted context omitted.

> Turning off overcommit (and swap) does improve responsiveness but is not a viable option for a desktop system Back when I got my first SSD I ran Linux without a swap file/partition. I did this partly because it was only a 60GB SSD so I wanted to conserve space. I also did it because I didn't want to shorten the life of the SSD with (this was back when such a thing was a concern) and I ran that set up for years on a…

> Back when I got my first SSD I ran Linux without a swap file/partition You can turn off swap if you don't need hibernate, and from memory even turning off overcommit used to be OK-ish (of course most software written for linux doesn't try to deal with failing malloc requests gracefully, because there's no point since it never happens in the default configuration). You end up with a noticeably snappier system. Howev…

> You can turn off swap if you don't need hibernate

Do people still hibernate? I thought these days suspending was a solved problem.

> Try turning off overcommit completely and see how long it takes Chrome to crash even if you have a lot of available memory.

I thought the point of this discussion was talking about sane defaults? Of course if you're going to mess with kernel parameters then you run the risk of getting undesired behaviour. It's no different to when we used to tweak the BIOS in the 90s. So I'm not going to disagree with you there. But what are you actually proving aside how easy it is to break things if you mess with core settings that are designed for experts?

> This is how spotlight works though, no? It's a separate process gets notified by the kernel on file system changes and then indexes them (that's what I meant with FS integration).

That's not file system integration though. What you were actually describing was a completely different behaviour. Moreover, you claimed that Spotlight works differently from other tools of it's ilk and that is also untrue.

> (spotlight is 15 years old tech and linux has had xattr support in all major file systems for ages)

Again, you don't want that information in the file system table. Storing every little bit of information like that in xattr would slow down standard file system operations. What you actually want to do is store that information in a separate RDBMS (eg sqlite3, MySQL/MariaDB, etc). To be honest even something like Redis might work as long as it has a persistent backup.

> as far as I'm aware there is no robust file system change notification API (you can use inotify for some stuff, but it's limited in various ways). I'd love to be wrong about this though.

I've not spent a great amount of time with inotify but from my limited exposure I do recall it wasn't great with nested hierarchies. There's probably some better ways that I don't know of but this is a particular problem I've not needed to solve before so I'm as in the dark as you are.

> I think the situation is better on macOS, but it might just be that spotlight is more polished and there is no fundamental difficulty in writing the same for linux these days.

Honestly, I think the perceived differences are all imaginary. Like wine tasting when you're told one bottle is expensive and another is moderately priced - lots of people will start to imagine deeper flavours in the more expensive bottle even if those flavours don't exist. So much of our perceptions are based on expectations rather than experiences and I think that's what's happening here because I've used both Krunner and Spotlight and my honest impression is that they're both much the same.

Re: Darling – macOS Translation Layer for Linux

#169
post #164

Earlier quoted context omitted.

> You can use lvm or zfs snapshots, but that's not what I'm talking about – I'm talking about in-app browsable history of things like documents or presentations. I got that. It's still just some application UI wrapped around a CoW file system. Maybe a better way of saying your point is "doing the same on Linux lacks a lot of polish" - which is true. But that's when happens when Linux has to support a multitude of fil…

> It's still just some application UI wrapped around a CoW file system. So? In terms of usability impact I still consider it a major feature (that no amount of tweaking will get you on Linux). > My point is you shouldn't have to install a 3rd party package manager. But macOS has a "package manager" – it's called App Store. You and I may not think it sufficient for our (developer) needs, but we're not representative u…

> (that no amount of tweaking will get you on Linux).

It best not to use such firm definitives like that when what you actually mean is "more tweaking than a typical user would be bothered with". :)

> But macOS has a "package manager" – it's called App Store. You and I may not think it sufficient for our (developer) needs, but we're not representative users.

You're seriously going to defend the App Store?! The App Store isn't just garbage for developers, it's garbage for everyone because it misses so many non-developer productivity tools too. It doesn't even have Chrome nor Firefox in it.

> And for normal users and even myself it offers very useful functionality over what they'd get out of the typical native linux package manger

Sorry but I'm not buying that argument. You claim to be a "normal user" then talk about messing around with kernel parameters in Linux. I really don't think you're making any fair and balanced arguments on this topic at all.

> You can trivially reinstall everything on a different machine with a different os version (as long as it's not super ancient), and it works – no "DLL" hell, because everything is essentially self-contained.

I guess if you compare the App Store to manually loading software on Windows - literally the worst platform ever created for managing installed software - then the App Store would look good. But likewise if you compare a heart surgery to a lobotomy then heart surgery would look less invasive too. This is why I don't think it's productive to compare solutions to the worst examples.

> And since software is tied to your account, there is no need for crufty apt queries in the hope to get a list of packages out you can backup for reinstall elsewhere or after clean upgrade.

It's a pity that the App Store offers so little software so you end up falling back to 3rd party package managers. So now on OSX you not only need to run the same "crufty [package manager] queries" on OSX but you also need to install the package manager itself too.

> And I need to install a 3rd party package manager on (non-NixOS) linux distros anyway, because IMO apt, yum etc. fundamentally suck and nix is the only thing that doesn't.

A moment ago you were claiming to be a "normal user". Normal users don't install nix :) tbh I'm not the biggest fan of apt, yum is better but I do really like pacman. However claiming apt and yum suck when also praising the OSX App Store is just weird.

> I can ensure you it's entirely possible to have a high grade desktop with SSD and have linux fall over swapping endlessly without even being able to move the cursor anymore. Of course this doesn't happen in "everyday" usage otherwise no one would be running linux, but it's not that hard to trigger if you're running a VMs, a few browsers and dev tooling stuff that can potentially consume large amount of memory very quickly.

Right, I get you now. That context helps. Your previous description just said you were running a browser and sounded like it was happening everyday (so basically you were exaggerating by leaving key details out when describing the root cause). The problem there is that you're not just over commiting on memory but also over commiting on CPU resources too. That latter part matters because swapping can be CPU expensive too. Hence why your system is grinding to a halt.

Also I still think you're to blame a little there because if you're running VMs then you should be setting their thresholds to a level that doesn't overcommit your systems resources (baring in mind these tools aren't the stuff that "normal users" would be using either). It's like opening a bottle of wine and pouring yourself 4 glasses then complaining that the bottle is empty and you couldn't squeeze out a 5th glass (can you tell I'm drinking wine at the moment hehe?). You only have a finite amount of system resources so you cant really complain if you intentionally over commit them.

Re: Darling – macOS Translation Layer for Linux

#170
post #128

Earlier quoted context omitted.

> How on earth is there still no terminal emulator like iTerm2 on linux????! Genuinely curious: What does iTerm2 do better than any other terminal emulator on Linux?

One thing I have not found (admittedly I have not searched much) is to be able to detect patterns printed on screen and launch triggers. E.g.: if something prints on screen "created a job XXX" I can color this text blue and make it an URL pointing to example.com/XXX

Look for "Triggers" under the "Advanced" tab of your profile. You just need to enter a regex and specify an action.
Post reply on HN