Thread: Is Linux Source written in C or C++ ?

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    29

    Is Linux Source written in C or C++ ?

    Hi !!,
    I wanted to know if the Linux source code and kernel written in C or C++ ? I would be really thankful if i could know as to which of the languages were choen and the reason as to one was chosen over the other .

    Thanks

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    65
    Linux Kernel is written in C.
    Well, I'm not totally sure why so but I think that as UNIX kernel was written also in C, and UNIX compatibility is a major issue of Linux, Linux Kernel is also written in C.

    Also in Linux kernel, there are a lot of unstructural codes (gotos, lots of global variables) for performance issues. Also C is today used for maximum efficiency instead of C++, so for an operating system code it is thought more suitable I think.

    Or maybe Linus Torvarlds did not know C++ while writing first codes in 1991.

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    79
    C can be translated very easily and literally to assembly, which allows programmers to do low level things without the restrictions of assembly(one of which is that assembly is very platform dependent).
    All generalizations are false

  4. #4
    Registered User
    Join Date
    Dec 2001
    Posts
    9
    C was developed by K&R (Ritchie, and Kernighan);
    Unix was then written in the new language, called C because it was better than B.

    Linux arises from Unix, therefore C is very proper to write in.
    C is also more standardized, and more trusted language, wich is important, the kernel is being written by people all over the world.
    The kernel is not poorly written, it even has it's own coding style.

    C++ was written by Bjarne Stroustrup. It is very much alike C, with more features, and lots of good stuff, while not having many drawbacks, except fror it complexity (and since when has THAT stopped me ). But it's younger and not as experienced as C, and there is still a taint of inconsistency in it, between compiler, wich is now disappearing.

    So linux will most probably continue to use C as it's main language, although seeing much more programs written in C++, wich wouldn't be a bad thing at all.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why Linux, for the average user?
    By Hunter2 in forum A Brief History of Cprogramming.com
    Replies: 32
    Last Post: 07-07-2006, 02:36 PM
  2. Continous LOD Terrain Source... Released!
    By Perspective in forum Game Programming
    Replies: 13
    Last Post: 04-17-2006, 11:21 PM
  3. Linux source
    By Vertex34 in forum Tech Board
    Replies: 1
    Last Post: 07-20-2004, 01:15 PM
  4. Linux source code
    By afreedboy in forum Linux Programming
    Replies: 6
    Last Post: 06-25-2004, 10:12 AM
  5. Linux Linux why Linux??
    By afreedboy in forum Tech Board
    Replies: 146
    Last Post: 01-21-2004, 06:27 PM