why only C?

Bernd Petrovitsch bernd at petrovitsch.priv.at
Sun Apr 3 15:49:47 EDT 2011


Hi!

On Mon, 2011-04-04 at 00:47 +0530, mohit verma wrote: [....] 
> As far as i can decipher , we impose Object oriented paradigm in
> kernel space using C  : like using gates to allow only one way entry
> and binding functions to structures in a OOP fashion  and trying to
> make them private to that structure only  , encapsulation of one
> struct into another structure (and lots of features ) and itself  lots
> of kernel subsystem supports like driver interface and blah blah
> behaving like **objects** .......

OOP is a design issue independent of the used programming language. So
you actually *can* do OOP with C (or assembler or ....) and I have seen
C++ programs which do not employ the ideas behind OOP.

> why dont we use some fully OOPs supportive language like JAVA or
> partial supportive language like  C++ to construct Linux Kernel????

What does it buy and what does it cost?

For - or more against - Java: You really do not want an OS to use an
interpreted "language". That kills performance. And the more interesting
challenge is to implement hardware IRQ handlers in Java.

C++ has lots of features which make it awkward to use. For starters,
think about the fact that Java does not have multiple inheritance.

> I don't  think that performance is the main reason behind all this .
> Is it??

Did you google for it and read the links etc.?
You will find much more on this question.

Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at




More information about the Kernelnewbies mailing list