Hacker News new | ask | show | jobs
by carlosrg 3930 days ago
Watched the video the other day, enjoyed it. Note that this already exists in OS X since Mavericks and in Linux since 3.11, although it's not enabled by default on any distro AFAIK (more info: https://www.kernel.org/doc/Documentation/vm/zswap.txt).

Related: I wish Apple did more things like this, videos explaining the internals of the system. The OS X kernel source code is open but you need a deep understanding of Mach and OS internals to understand what's going on. And most processes and services running on the background are closed source and who the hell knows what's going on.

1 comments

Apple has been very serious about not wanting you to know what's going on in your machine since around 1984. The first Mac needed an extra-long hex wrench to open, a very uncommon tool at the time. They want good developer communities for good apps, yet they don't give them full control.
I don't know about "not wanting you to know what's going on in your machine." It's more like they want you to treat their public OS API as "the machine": a clean black-box abstraction layer you can build on.

What goes on underneath, while interesting, is not guaranteed to be stable. They might, say, replace x86 with ARM one day, as they already replaced PPC with x86. If you're targeting "the OSX platform", that doesn't affect you; you just hit rebuild in XCode. If you're targeting the underlying computer, you're screwed. Apple doesn't want you to be screwed (really, they don't!), so they try to disincentivize relying on anything below the public API.

Compare this to Microsoft, where the Windows team deals with cases like these[1] by inserting compatibility shims to keep the behavior of applications using undocumented, non-public-APIs (or munging kernel-shared opaque structs, even) stable between OS releases. While it's great for end-users—their apps don't break—it incentivizes relying on private APIs, because Microsoft will effectively keep your app running for you.

[1] http://blogs.msdn.com/b/oldnewthing/archive/2003/12/23/45481...

How is that relevant to a video like this? It's not something you can leverage directly by tapping into a private API or something. It's just information about how it works, which indirectly can benefit you as a programmer but the technique itself is transparent and could be removed tomorrow without any (other) consequences (unless I missed something, didn't watch the whole thing).