What Languages are Windows, Mac OS X and Linux wri

2019-01-12 13:38发布

I was just wondering who knows what programming languages Windows, Mac OS X and Linux are made up from and what languages are used for each part of the OS (ie: Kernel, plug-in architecture, GUI components, etc).

I assume that there are multiple languages for each and obviously I know the Linux kernel is written in C.

I'm totally guessing here that Mac OS X contains a lot of Objective-C code as it is Apple's language derived from NeXT.

Windows, I have heard contains C, C++ and Intel Assembly. Do Linux or Mac OS contain any Assembly code?

Also, are there scripting languages like Ruby, Python, etc used by the OS developers for scripting parts of the OS? What parts of the OS would be written in each language?

13条回答
疯言疯语
2楼-- · 2019-01-12 13:47

I understand that this is an old post but Windows is definitely not written in C++. There is lots of C++ in it but what we technical define as an operating system is not in C++. The Windows API, the Windows kernel (both of these are in essence what an operating system is) are written in C. Years ago I was given some leaked code for both Windows 2000 and Windows XP. The code was not nearly complete enough to compile the kernel or API but we were able to compile individual programs and services. For example, we were able to successfully compile Notepad.exe, mspaint.exe, and the spoolsv.exe service (print spooler). All written in C. I have not looked again but I am sure that leaked code still survives as torrent files out there that may still be available.

查看更多
Viruses.
3楼-- · 2019-01-12 13:51

I have read or heard that Mac OS X is written mostly in Objective-C with some of the lower level parts, such as the kernel, and hardware device drivers written in C. I believe that Apple "eat(s) its own dog food", meaning that they write Mac OS X using their own Xcode Developer Tools. The GCC(GNU Compiler Collection) compiler-linker is the unix command line tool that xCode used for most of its compiling and/or linking of executables. Among other possible languages, I know GCC compiles source code from the C, Objective-C, C++ and Objective-C++ languages.

查看更多
女痞
4楼-- · 2019-01-12 13:52

Mac OS X uses large amounts of C++ inside some libraries, but it isn't exposed as they're afraid of the ABI breaking.

查看更多
5楼-- · 2019-01-12 13:52

As an addition about the core of Mac OS X, Finder had not been written in Objective-C prior to Snow Leopard. In Snow Leopard it was written in Cocoa, Objective-C

查看更多
虎瘦雄心在
6楼-- · 2019-01-12 13:54

Windows is obviously not written in C# (!)

Simply see the source code of Windows and you'll see...

查看更多
戒情不戒烟
7楼-- · 2019-01-12 14:00
  • Windows: C++, kernel is in C
  • Mac: Objective C, kernel is in C (IO PnP subsystem is Embedded C++)
  • Linux: Most things are in C, many userland apps are in Python, KDE is all C++

All kernels will use some assembly code as well.

查看更多
登录 后发表回答