Results 1 to 3 of 3
What would be the benefits and drawbacks of a kernel, linux for example, written entirely in c++, as opposed to c? The only drawbacks I can think of is that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-17-2007 #1
- Join Date
- Sep 2006
Pure C++ Linux Kernel
What would be the benefits and drawbacks of a kernel, linux for example, written entirely in c++, as opposed to c? The only drawbacks I can think of is that a c++ kernel would take more code, and might run slightly slower than a kernel written in c. A c++ kernel would also be much more complex, but I think that is also its greatest attribute. I think a c++ kernel would allow for tighter integration of software written in c++, and other object-oriented languages such as java, ruby, etc. I opt for doing away with c alltogether because I think every aspect of the O.S. should be object-oriented. Another benefit would be the ease of porting code from one O.O. language to another. Integration of elements of the kernel, and other programs that are written in O.O. languages would be more seamless and tightly integrated. I also think that fuzzy logic and a.i. would be easier to implement with the O.O. coding style. And I think one of the most important benefits would be a standardization initiative. Having all system and application code written in the O.O. style would allow for great familiarity of all code you will ever encounter, more managable, and better learning curve esp. for new programmers, or programmers only familiar with one O.O. language.
- 06-23-2007 #2
- Join Date
- Apr 2005
Linux: C++ In The Kernel? | KernelTrap
I think basically, C++ is a little too high-level to be a good idea, plus Torvalds flames anyone that suggests it :P.Registered Linux user #393668
- 06-24-2007 #3
As I have read and think: it's not usually a good idea to use a language that manages its own memory in a kernel, I also agree with Torvalds when he says that C++ compilers can't be trusted, they simply take your code and do whatever they think is what you want, it's not predictable enough for a kernelPut your hand in an oven for a minute and it will be like an hour, sit beside a beautiful woman for an hour and it will be like a minute, that is relativity. --Albert Einstein
Linux User #425940
Don't PM me with questions, instead post in the forums