Musk says he wants to completely refactor Twitter’a code base like Apple did with OSX.

Who wants to tell Musk that it took Apple ~11 years to launch OSX?

@dataandpolitics @glennf also, Mac OS X was not a refactor of Mac OS 8.x/9, it was a refactor of NeXTSTEP to which several libraries were grafted… you cannot rewrite a complex system, you need to evolve it.

@juandesant @dataandpolitics @glennf

The differences between #MacOSX and #NeXTSTEP were larger than what people would conventionally think of as a refactor. I think it would be more accurate to say NeXTSTEP provided the architecture for Mac OS X, but most of it was rebased and ported directly from upstream sources. I am sure that I will misremember something, but what I recall off the top of my head:

1/7

@juandesant @dataandpolitics @glennf

1. The kernel (#xnu) was amalgamation of code that was mostly independent of NeXT. #NeXTSTEP was based on Mach 2.5 & 4.3BSD with an ObjC based DriverKit. xnu was built from #osfmk which was Mach 3.0 and ported to Mac HW as part of the #MkLinux project, a fresh rebase of 4.4BSD-Lites2, and the driver system (#IOKit) was a ground up redesign, despite the existence of DriverKit and NuIO.

2/7

@juandesant @dataandpolitics @glennf

2. The unix tools and libraries that were not from 4.4BSD-Lites2 were imported from #FreeBSD and/or #NetBSD. Things like NetInfo did come from #OpenStep.

3. Carbon was a port of some of the classic MacOS APIs to Mac OS X. Some of it was new, but a lot of it was existing code from (among other places) QuickTime for Windows, which had reimplemented substantial portions of the toolbox in C as part of their port.

3/7

@juandesant @dataandpolitics @glennf

4. The WindowServer was new code and broke source and bincompat with the old #DisplayPostscript based window server

5. Classic was a para-virtualized environment running almost the entire classic OS. New code was written to support things like FS and Network sharing, etc. As I recall developers were first demo’ed classic running on #NuKernel at labs at #WWDC, and it was ported to Mac OS X shortly after that.

4/7

@juandesant @dataandpolitics @glennf

6. Foundation came from #NeXT, but if we are being pedantic it wasn’t from #NeXTSTEP, it was from #OpenStep. All the old NeXTSTEP classes start with NX, not NS.

7. Foundation was actually split in two and new C implementations of most of the low level bits were written (CoreFoundation) so it could be used as common infrastructure for Carbon and Cocoa (and back ported to classic MacOS).

5/7

@juandesant @dataandpolitics @glennf

8. Most the media frameworks came from Apple (#QuickTime) or were written post merger (#Quartz/#CoreGraphics).

NeXT provided valuable technology to Apple, and more importantly focused management. But in terms of code NeXT was not the largest progenitor of #MacOSX, at least if we discount code NeXT acquired from other sources and Apple subsequently replaced with newer upstream ports prior to shipping Mac OS X.

6/7

@juandesant @dataandpolitics @glennf

I think it would be more accurate to claim #MacOSX was an updated port of #osfmk (OSF, CMU, Apple) with a brand new driver SDK (post-merger Apple) using a new port of 4.4BSD-Lite2 (UC Berkeley) hosting a new WindowServer (post-merger Apple) running frameworks ported from OpenStep (NeXT: Cocoa) and classic MacOS (Apple: Carbon) that were both refactored to share common infra (post-merger Apple: CoreFoundation).

7/7

@lgerbarg @dataandpolitics @glennf I was certainly simplifying, but I love your detailed account…

Indeed, only Apple could have made a new Mac OS operating system, and the did a lot of things right, thanks to having now management alignment on what the technology stack would —more or less look like—, and not allowing turf wars to derail the project.