我只是想知道谁知道Windows、Mac OS X和Linux是由哪些编程语言组成的,以及操作系统的每个部分都使用了哪些语言(例如:内核、插件架构、GUI组件等)。

我假设每种都有多种语言,显然我知道Linux内核是用C编写的。

我完全猜测Mac OS X包含大量Objective-C代码,因为它是苹果从NeXT派生的语言。

Windows,我听说包含C, c++和英特尔汇编。Linux或Mac OS是否包含任何汇编代码?

还有,是否有像Ruby, Python之类的脚本语言被操作系统开发者用来编写部分操作系统的脚本?操作系统的哪些部分是用每种语言编写的?


当前回答

Windows:主要是C和c++,还有一些c#

其他回答

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.

请参阅标题下的一个操作系统在多个平台上运行,其中说明:

Most of the source code for Windows NT is written in C or C++.

Windows:主要是C和c++,还有一些c#

作为Mac OS X核心的一个补充,Finder在Snow Leopard之前还没有用Objective-C编写。在Snow Leopard中,它是用Cocoa Objective-C编写的

The Linux kernel is mostly written in C (and a bit of assembly language, I'd imagine), but some of the important userspace utilities (programs) are shell scripts written in the Bash scripting language. Beyond that, it's sort of hard to define "Linux" since you basically build a Linux system by picking bits and pieces you want and putting them together, and depending on what an individual Linux user wants, you can get pretty much any language involved. (As Paul said, Python and C++ play important roles)