Google Answers Logo
View Question
Q: Linux kernel in C why not C++ ($10) ( Answered 4 out of 5 stars,   0 Comments )
Subject: Linux kernel in C why not C++ ($10)
Category: Computers > Operating Systems
Asked by: rkalyankumar-ga
List Price: $10.00
Posted: 13 Apr 2006 15:35 PDT
Expires: 13 May 2006 15:35 PDT
Question ID: 718661
What are the reasons for the Linux (in general all unix including
solaris) Kernels are written in C & why not in C++. While C++ is a
better language than C in terms of object oriented concepts, why
Kernels or most popular database systems are written in C instead of
C++ programming language.
Thank you
Subject: Re: Linux kernel in C why not C++ ($10)
Answered By: maniac-ga on 13 Apr 2006 19:42 PDT
Rated:4 out of 5 stars
Hello Rkalyankumar,

The reasons specifically for Linux are explained in great detail as
part of the Linux Kernel Mailing List (LKML) Frequently Asked
Questions (FAQ) at:
Scroll down to section 15 (titled Programming Religion) and read the
explanation. A summary is:
 - Linus started with an 386 computer, Minix, and gcc (no g++ available)
 - C is used instead of Assembly for a LOT of reasons (maintenance,
readability, efficiency, ...)
 - it is not clear how an object oriented language helps in OS design
 - MANY years ago, they tried using g++ to compile the Linux kernel
and found it ran slower than when compiled with gcc (many thought it
should have been the same); they are not willing to do this again
 - Linus makes the final decision and he's decided to stick with C
There is also another good explanation of some of the issues at
which describes one person's attempt to build adapt some C++ code to
incorporate into a kernel module.

For a historical perspective, Thompson and Ritchie developed Unix
using some of the concepts from Multics and CTSS
including implementation of most operations in a higher order language
(Unix - C, Multics - PL/I), common naming of commands, etc. I also
refer you to
which describes the EARLY development of Unix including the conversion
from Assembly on the PDP-7 to C on the PDP-11 (near the end of the

Building from that basis, the Unix from AT&T that was widely
distributed and worked on by thousands of people was a C based
operating system. In the 1970's and 1980's, an alternative to AT&T's
distribution was developed at UC Berkeley, see
for a relatively short explanation of the development of BSD. The BSD
version eventually did not use ANY of the AT&T code base, but was also
implemented in C. At the end of the article is a list of several BSD
descendants including SunOS (now Solaris).

That is not to say that some applications are better implemented in an
OO language such as C++. There are several Graphical User Interface
(GUI) toolkits such as KDE which are implemented in C++. However,
there are applications that are better suited for a more procedural
language, and at this point operating systems are in that category.

If this answer is unclear or somehow incomplete, please make a
clarification request.
Good luck with your work.


Request for Answer Clarification by rkalyankumar-ga on 13 Apr 2006 21:56 PDT
Hi maniac,

Thanks for this answer. Convinced with the answer about C & linux
(UNIX) kernels. But your answer doesn't include one point i.e. most
popular databases are also developed in C - Please refer my question
posted ?
I think I am convinced with your answer except for the above one. 

Thank you.

Clarification of Answer by maniac-ga on 14 Apr 2006 19:28 PDT
Hello Rkalyankumar,

With respect to database applications, many (but not all) of the
popular ones are written in C for the same types of reasons:
 - developed on a Unix (or Linux) system
 - developed many years ago when the "best" HOL for that kind of application was C
INGRES was an example of this heritage. There may be some recent OO
databases that buck this trend, but popular ones are primarily written
in C.

Database applications for other operating systems were written in the
"primary" language for that OS. For example, on Multics, MRDS was
written in PL/I
Its pretty clear (though not quite certain) that System R, developed
by IBM which helped establish SQL as a standard query language (it was
called SEQUEL at that time...) was not written in C, but likely in
PL/I and/or assembly. See'sCSResearch.pdf
for a 1980 look inside of IBM's San Jose research lab which lists the
languages in use there (PL/I, Assembly, PL/S, and Pascal) and mentions
the development / use of System R.

Since C is the primary language used on Windows and Unix / Linux (and
those platforms represent most of the systems in use today), it is a
natural outcome that C was also used for data base applications on
those platforms.


Request for Answer Clarification by rkalyankumar-ga on 18 Apr 2006 03:00 PDT
Hi maniac,
Please let me have the google search terms used.

Many thanks.


Clarification of Answer by maniac-ga on 18 Apr 2006 08:15 PDT
Hello Rkalyankumar,

Search phrases used to collect information for this answer included:
 - linux kernel c++
 - unix multics
 - unix history
 - unix BSD history
 - multics database
 - unix database
 - "system r" ibm
 - [database name] history
(choice of some of these phrases was based on personal knowledge / use
of the products mentioned)

rkalyankumar-ga rated this answer:4 out of 5 stars and gave an additional tip of: $1.00

There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy