I was curious what language the default binaries and system binaries that come with macOS are written in. I am sure it's not just one language, but is there one language that is common throughout most of these binaries that come with the system?
1 Answer
macOS is built on BSD which is a Unix like operating system.
The Unix operating system and the C language were created simultaneously. Many of the commands have evolved over time but usually have remain written in the C language. The libraries and the Unix operating system is also written in C.
The C language is probably the closest high level language that actual resembles machine instructions. This allows Unix to be ported to new processor architectures with minimal effort. In other words, the optimizations were originally provided by the author's of the code and did not rely on compiler specific optimizations with respect to a particular processor architecture.
Note: Gordon Davisson has pointed out in a comment:
... macOS includes a lot more than just its Unix core, and a lot of the Apple-added software is written in other languages, like Objective-C, Swift, and a plethora of other languages.
-
1You're confusing unix (which was created simultaneously with C, and which macOS is based on) with Linux (which is a mostly-clone of unix, written much later). If you replaced "Linux" with "unix" throughout your answer, it'd be mostly correct; as it stands, it's completely wrong. But I'd also point out that macOS includes a lot more than just its unix core, and a lot of the Apple-added software is written in other languages, like Objective-C, Swift, and a plethora of other languages. Commented Aug 24, 2018 at 7:15
-
@Gordon Davisson: Sorry for the mistake. Just tired I guess. I made the Unix correction. I understand Apple added software to create macOS, but the OP referred to the bin and sbin directories. If the OP had not referred to those specific directories, then I agree you would be right. Commented Aug 24, 2018 at 7:40