What languages are Windows, Mac OS X and Linux written in?

后端 未结 13 2123
借酒劲吻你
借酒劲吻你 2020-12-04 04:16

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-

相关标签:
13条回答
  • 2020-12-04 04:57

    Windows: Mostly C and C++, some C#

    0 讨论(0)
  • 2020-12-04 04:59

    Wow!!! 9 years of question but I've just come across a series of internal article on Windows Command Line history and I think some part of it might be relevant Windows side of the question:

    For those who care about such things: Many have asked whether Windows is written in C or C++. The answer is that - despite NT's Object-Based design - like most OS', Windows is almost entirely written in 'C'. Why? C++ introduces a cost in terms of memory footprint, and code execution overhead. Even today, the hidden costs of code written in C++ can be surprising, but back in the late 1990's, when memory cost ~$60/MB (yes … $60 per MEGABYTE!), the hidden memory cost of vtables etc. was significant. In addition, the cost of virtual-method call indirection and object-dereferencing could result in very significant performance & scale penalties for C++ code at that time. While one still needs to be careful, the performance overhead of modern C++ on modern computers is much less of a concern, and is often an acceptable trade-off considering its security, readability, and maintainability benefits ... which is why we're steadily upgrading the Console’s code to modern C++.

    0 讨论(0)
  • 2020-12-04 05:03

    Linux: C. Some parts in assembly.

    [...] It's mostly in C, but most people wouldn't call what I write C. It uses every conceivable feature of the 386 I could find, as it was also a project to teach me about the 386. As already mentioned, it uses a MMU, for both paging (not to disk yet) and segmentation. It's the segmentation that makes it REALLY 386 dependent (every task has a 64Mb segment for code & data - max 64 tasks in 4Gb. Anybody who needs more than 64Mb/task - tough cookies). [...] Some of my "C"-files (specifically mm.c) are almost as much assembler as C. [...] Unlike minix, I also happen to LIKE interrupts, so interrupts are handled without trying to hide the reason behind them. (Source)

    Mac OS X: Cocoa mostly in Objective-C. Kernel written in C, some parts in assembly.

    Mac OS X, at the kernel layer, is mostly an older, free operating system called BSD (specifically, it’s Darwin, a sort of hybrid of BSD, Mach, and a few other things)... almost entirely C, with a bit of assembler thrown in. (Source)

    Much of Cocoa is implemented in Objective-C, an object-oriented language that is compiled to run at incredible speed, yet employes a truly dynamic runtime making it uniquely flexible. Because Objective-C is a superset of C, it is easy to mix C and even C++ into your Cocoa applications. (Source)

    Windows: C, C++, C#. Some parts in assembler.

    We use almost entirely C, C++, and C# for Windows. Some areas of code are hand tuned/hand written assembly. (Source)

    Unix: C. Some parts in assembly. (Source)

    0 讨论(0)
  • 2020-12-04 05:03

    You're right MacOSX has Objective-C in the core.

    Windows C++

    Linux C

    About the scripting languages, no, they pretty much high level.

    0 讨论(0)
  • 2020-12-04 05:07

    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.

    0 讨论(0)
  • 2020-12-04 05:10

    See under the heading One Operating System Running On Multiple Platforms where it states:

    Most of the source code for Windows NT is written in C or C++.
    
    0 讨论(0)
提交回复
热议问题