Why is macOS sometimes called ‘Darwin’?
It is not. macOS is not Darwin and Darwin is not macOS.
The historical past of macOS is lengthy, convoluted, and complex.
It begins with Steve Jobs (not totally voluntary) “leaving” Apple and founding NeXT. NeXT wished to revolutionize the Private Workstation. They constructed each a robust pc, the NeXT Laptop (later NeXTstation and NeXTcube), and a strong, fashionable Working System, referred to as NeXTStep. (Get it? The following step for the subsequent pc. Actually artistic naming.)
The Working System was based mostly on porting BSD to a Mach microkernel, and including object-oriented system libraries, frameworks, and toolkits (referred to as “kits”, which you’ll nonetheless see in Apple’s naming at this time), with an object-oriented GUI framework and desktop, with object-oriented purposes, all written in a contemporary object-oriented programming language (Goal-C) because the techniques language, on prime of the bottom BSD system. The show system was based mostly on PostScript, and there was even an Intel i860 coprocessor operating a stripped-down model of the OS, just for Show PostScript processing, plus a robust DSP for video and audio processing.
NeXTStep pioneered many issues we see in fashionable GUI programming. It had one of many first graphical GUI Builders, which nonetheless to today is the way you design GUIs for macOS, iOS, iPadOS, and so forth. (Right now, it’s referred to as the Xcode Interface Builder.) It had the primary ever App Retailer. When Tim Berners-Lee invented the World Large Internet, he selected NeXTStep because the OS to jot down the primary browser for. Many sport studios used NeXTStep and NeXT workstations for his or her improvement, e.g. id software program for Doom, Doom 2, and Quake. Lotus Improv, nonetheless thought of by many to be miles forward of Excel even now, was carried out on NeXTStep.
Later, NeXT divorced the higher-level frameworks from the underlying OS and made them obtainable below the identify OpenStep for Home windows NT, Solar Solaris, and below the identify “OPENSTEP for Mach” nonetheless based mostly on the identical underpinnings as the unique NeXTStep.
At this level, Apple had tried and failed a number of instances to modernize MacOS, and so they purchased NeXT (thus bringing Steve Jobs again into the corporate) and all of its Mental Property and know-how to develop a successor to MacOS based mostly on OPENSTEP for Mach. They modernized the Mach kernel from 2.5 to three and prolonged it with ideas from the FreeBSD kernel to type a kernel often called xnu (a reference to the failed nuKernel mission at Apple which was to develop a “new kernel”), and the BSD underpinnings from 4.3BSD to 4.4BSD and later FreeBSD.
Most significantly, they prolonged and expanded the OpenStep APIs and constructed new APIs on prime. The gathering of these APIs is named “Cocoa”. In addition they constructed an API referred to as “Carbon”, which was a detailed, however not similar re-implementation of a subset of the MacOS API on prime of the brand new foundations. (The intention was that whereas it will not be attainable to easily re-compile present MacOS purposes, it ought to be pretty simple to port them to Carbon, after which through the years rewrite them in Cocoa.)
The primary prototype of this technique was referred to as Rhapsody. The complete system wasn’t completed in time, so a subset was launched as MacOS X Server 1.0. And the remainder is historical past: Rhapsody grew to become MacOS X, then OS X, then macOS, and someplace alongside the best way, iOS was cut up off, after which additional divided into iOS, iPadOS, tvOS, and watchOS.
Now, again to Darwin: Darwin is principally the underpinnings of macOS, from the xnu kernel, IOKit, drivers, and so forth. as much as the BSD libraries and userland, plus some macOS-specific developments reminiscent of mDNSresponder and launchd. It doesn’t, nonetheless, embrace any components of what was OpenStep, Cocoa, Aqua, Quartz, QuickTime, or any of the opposite higher-level stuff. It does include drivers and filesystems, though I’m not totally positive whether or not APFS is a part of Darwin.
If you happen to suppose again to the time limit the place NeXT “divorced” the high-level OpenStep from its underpinnings, the low-level components which can be not OpenStep could be those that may later turn into Darwin.
To start with, Apple used to make Darwin obtainable as a separate OS, together with compiled binaries, installers, ISOs, and so forth. that you may set up on Apple {hardware}. Nonetheless, for a few years now, Apple solely supplies a supply code dump, each time a brand new launch of macOS comes out. It is not even attainable to compile this supply code, as a result of it will depend on Apple’s inside construct instruments and construct pipeline. There have been some tasks attempting to patch Darwin to compile it with publicly obtainable instruments, however these tasks have all died from lack of curiosity.
Since all the stuff you talked about have been born on Unix and use Unix APIs and Unix libraries, they really sometimes do not even know concerning the “non-Darwin” components of macOS, so it’s only logical that they may think about the OS to be “Darwin”. Word that “Darwin” can also be what will get returned because the identify of the OS if you name the Unix/POSIX int uname(struct utsname *buf)
library perform or the uname
Unix/POSIX commandline utility.
So, to reply the query you did not ask explicitly however is implicit in your query: why does Node.js return “Darwin” for the identify of macOS? As a result of when Node.js asks macOS for its identify, that is what macOS tells it its identify is!