<br><br><div class="gmail_quote">On Sun, Apr 3, 2011 at 8:17 PM, mohit verma <span dir="ltr"><<a href="mailto:mohit89mlnc@gmail.com">mohit89mlnc@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi list,<div><br></div><div>I have a very basic question. </div><div><br></div><div>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** .......</div>
<div><br></div><div>why dont we use some fully OOPs supportive language like JAVA or partial supportive language like C++ to construct Linux Kernel????</div><div><br></div><div>I don't think that performance is the main reason behind all this . Is it??</div>
<div><br></div><div>Thanks a lot in advance.</div><br></blockquote></div><br>Read more or even google it.<br>Besides its Design decision by Linus Torvalds<br><br>Here is the historic mail explaining what he said<br><pre>
<b>From: Linus Torvalds</b> [email blocked]
Subject: Re: Compiling C++ kernel module + Makefile
Date: Mon, 19 Jan 2004 22:46:23 -0800 (PST)
On Tue, 20 Jan 2004, Robin Rosenberg wrote:
>
> This is the "We've always used COBOL^H^H^H^H" argument.
In fact, in Linux we did try C++ once already, back in 1992.
It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.
The fact is, C++ compilers are not trustworthy. They were even worse in
1992, but some fundamental facts haven't changed:
- the whole C++ exception handling thing is fundamentally broken. It's
_especially_ broken for kernels.
- any compiler or language that likes to hide things like memory
allocations behind your back just isn't a good choice for a kernel.
- you can write object-oriented code (useful for filesystems etc) in C,
_without_ the crap that is C++.
In general, I'd say that anybody who designs his kernel modules for C++ is
either
(a) looking for problems
(b) a C++ bigot that can't see what he is writing is really just C anyway
(c) was given an assignment in CS class to do so.
Feel free to make up (d).
                Linus</pre><br>