macOS Internals
51–60 of 146 posts
Re: macOS Internals
#52The window server is "lightweight" in that it does no screen drawing itself. It is, to use Apple's term, "drawing model agnostic." WindowServer is such a behemoth nowadays, it took me ages to reverse engineer how to make rcmd ( https://lowtechguys.com/rcmd ) control Stage Manager. It’s interesting to see it described as lightweight . I guess every lightweight solution becomes heavy and complex with enough usage.
Once I started using it I was wondering how I worked without it
Re: macOS Internals
#53Re: macOS Internals
#54Earlier quoted context omitted.
Yup. APIs and constraints all make engineering sense. Turtles, all the way down... except when you get to quantum mechanics, that stuff is whack.
> QM is whack Very much so. But I also think it always had to be that way. A universe of infinite classical regression (atoms made of atoms made of atoms...) would be more insane than whack .
Re: macOS Internals
#55It's impressive how so many years after he left, the legendary articles by John Siracusa are still having an impact.
For newer macOS changes, Howard Oakley's blog is really awesome: https://eclecticlight.co/category/macs/
They all have intimate insights into macos internals from reverse engineering it.
Re: macOS Internals
#56History is such a great way to learn anything. It’s interesting - like a mystery revealed, but also provides the why - why things are the way they are. I was looking into accounting the other day, and you can go back to the first document that mentioned credit and debit and introduced modern accounting. There are so many topics like this that seem confusing and arbitrary but it all began extremely simply and pragmati…
Agreed. This is why often reading a Wikipedia page is the worst way to learn something. The best way is to get a teacher to tell you the relevant history leading up to the thing, and it makes much more sense.
Re: macOS Internals
#57Man, I miss those 20+ pages long Ars Technica reviews. They don't seem to publish these kind of stuff anymore.
Re: macOS Internals
#58- XPC/Mach is a pretty reasonable IPC system that avoids the huge complexity of DCOM, whilst being more widely adopted throughout the platform than DBUS.
- Bundles are frustratingly ad-hoc in terms of detection and layout but the basic concept does work, and is better than the (rough, not really) equivalents on Windows and Linux.
- Launch Services does a pretty good job these days of letting apps be purely declarative whilst still keeping track of all the integration points things (in the past it's been a bit rough).
- APFS is a very modern FS and the migration of the Apple ecosystem to it was so well executed it was barely even noticed. I can't think of any other platform that has managed to do a migration from one FS to another so smoothly.
- Ditto for CPU architecture migrations. Apple's skill at these has become rather legendary now. I remember a time when the computer industry assumed such transitions were simply impossible, Apple did it twice!
- The code signing infrastructure is rather complex but well thought out and flexible, even though Apple don't use all that flexibility in practice. They've chipped away at it over the years and by now it delivers concrete and real benefits to end users. In particular it enables apps to be kept somewhat separated even when they aren't sandboxed e.g. on Ventura apps can't tamper with each other unless you specifically give them that permission, and this works without any notion of admin/root escalation or installation, and that's true even if apps aren't opted in to the app sandbox.
- The way Apple live the UNIX spirit by having lots of little CLI tools along with man pages for those tools etc is pretty nice.
- The sheer quantity of APIs and frameworks that solve modern high level problems is well ahead of any other desktop platform by miles (e.g. the ML frameworks, data syncing).
- The way Apple have managed to slowly migrate code out of the kernel is well executed IMO. Likewise for SIP and their whole security/immutable OS posture, something the Linux world is still just experimenting with and Windows isn't even trying.
- Their integration API for cloud storage is solidly designed, albeit it's a pity they don't also offer a lower level FUSE-like API for experimental use cases.
There are problems too of course. It's very weak that the OS has no way to keep apps up to date except via the store, which then introduces tons of other problems. Sparkle does a great job of patching up this gap, but it should really be a core OS service in this day and age. And the lack of any high level GCd/managed language for their platform continues to be a major weakness. You can have smooth UI and 60fps whilst still offering GC as Android has now proven, and of course there are large classes of apps where developer productivity matters more anyway. Microsoft always recognized that, even the Linux community understood this hence all the bindings into Python.
Re: macOS Internals
#59Re: macOS Internals
#60macOS probably doesn't get enough love from an OS design perspective. Over the years I've had reasons to work pretty closely with the guts of all of Linux, macOS and Windows and macOS is probably my favourite, design wise, although for some tasks you can't beat the flexibility and feature set of Linux. A few highlights that are lesser known: - XPC/Mach is a pretty reasonable IPC system that avoids the huge complexity…
- Code signing. It's incredibly frustrating as a developer to try and codesign an application to pass gatekeeper, requiring multiple steps with very little information as to what's _actually_ going on or going wrong in the middle of it, including uploading your entire bundle to Apple and waiting an arbitrary amount of time for them to notarize it.
> It's very weak that the OS has no way to keep apps up to date except via the store, which then introduces tons of other problems. Sparkle does a great job of patching up this gap, but it should really be a core OS service in this day and age.
App Store _is_ the solution and a core OS service. You may not like the limitations that implies, but it is the OS level solution for keeping apps up to date.
> And the lack of any high level GCd/managed language for their platform continues to be a major weakness.
I think swift fits this gap nicely, no? It's not technically GC'ed, but it is refcounted, which for end user case achieves the goal of "ignore memory mangement for small tasks" I like this blog post [0] which shows a desktop app in 11 lines of code.
[0[ https://www.amimetic.co.uk/blog/swiftui-for-small-internal-d...