On Fri, May 04, 2007 at 04:32:27PM +0800, la deng wrote:
>reference to the c++'s father's interview
>
>http://www.artima.com/intv/abstreffi.html
>
>fortran and c++ can achive good performance for they can abstract in
>higher level and their compiler can think in higher level to avoid
>the cache miss (like in the array vs vector )or to achive the "no
>code" Optimization
>
Well, it seems
well,I mean when use c as a higher level assembly maybe it a good
>The vfs using c to OOP but c compiler can't have the high level
>Intelligence as the c++ or fortran's compiler to help at the high
>level Optimization
>
We just borrow the OOP ideas from OOP languages, like C++/Java/Python, but we can't use any of them. The reasons can be summarized as the following:
1. Those languages, like C++, hide many things behind you. But kernel needs to know those things.
2. Those languages can't be (well) mixed with assembly.
3. Speed is crucial for kernel, while those languages can't surpass C.
>
>one benchmark showed the c insert in the array will slow by speed of 1/17
What benchmark? If your algorithm is well designed, C can't be more slowly.
>
>
>Then ,what's the power of c OOP vs c++ with the compiler's
>Intelligence in OOP?or maybe the c compiler have Outdated?
>
C compiler is _not_ out of date, of course. Why we choose OOP in C is explained above.
In a word, we choose OOP because it's a good idea like you wanna show us, we prefer C because of it's low-levelness and speed.
>any input will be appreciated.
Regard!
WANG Cong