Friday, April 8, 2011

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

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?

From stackoverflow
  • Windows: Mostly C and C++, some C#

    Aaron : c#!!! NO WAY, REALLY??????!
    Jonathan Parker : .NET is shipped with Windows. A lot of .NET is in C#.
    Jonathan Parker : There's rumors that future versions (Windows 8 maybe) of windows will have some C++ code replaced with C#/.NET.
    Randolpho : They've already managed a working OS (almost) completely in C#. It's called Singularity. http://research.microsoft.com/en-us/projects/singularity/
    Sharique : C/C++ is managed(.net version of) C/C++
    Larry Osterman : Luc M: Yes, there's C# code in Windows. Poke around and you'll find it. .Net is shipped with the OS but it doesn't mean the OS is written using .Net. And Windows isn't Singularity. There's a huge difference between a research prototype and a real operating system.
    Joachim Sauer : I'm pretty sure at least Windows XP can work entirely without any .NET runtime installed (I'm not sure about Vista), so there can't be any C# in there.
    Brock Woolf : C# consists of bytecode and a virtual machine....if they used that in Windows it would make it rather slow... Oh... now i see.
    1800 INFORMATION : Obviously XP was released a long time before .Net so it would have no dependancy on .Net
    1800 INFORMATION : @Brock - you have some seriously wrong information there - C# compiles to IL or native machine code, from there the JIT compiles the IL to machine code when it is run. There is no bytecode and no virtual machine. Perhaps you are thinking of Java?
    Brock Woolf : @1800Information - C# compiles to machine code from there JIT compiles to machine code when run? I think you are the confused one. There IS bytecode and there IS a virtual machine: http://en.wikipedia.org/wiki/Common_Intermediate_Language
  • You're right MacOSX has Objective-C in the core.

    Windows C++

    Linux C

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

    abatishchev : Windows in C: kernel, drivers, API. Only system applications and tools in C++, I guess. So it's more clear to say just C
    • 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++
  • 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)

  • 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.

  • http://www.lextrait.com/vincent/implementations.html

    this should helped

  • Windows is obviously not written in C# (!)

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

    Joachim Sauer : "Simply see the source code of Windows" if you're one of the few that is allowed/able to do that ...
    abatishchev : There are a lot of Windows source code parts in Torrents, also a few reviews of it
    unwind : Parts of the Windows code have leaked out, years ago. See for instance this old thread: . :)
  • Mac OS X uses large amounts of C++ inside some libraries, but it isn't exposed as they're afraid of the ABI breaking.

0 comments:

Post a Comment