DragonFly kernel List (threaded) for 2009-01
DragonFly BSD
DragonFly kernel List (threaded) for 2009-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: C++ in the kernel


From: "Pieter Dumon" <pieter.dumon@xxxxxxxxx>
Date: Wed, 7 Jan 2009 21:50:46 +0100

Actually, The language of choice is not the important question. It's
the conceptual/implementation innovation in DragonFly which matters.
As we move to highly multicore or high CPU count computer systems even
for consumer applications, the things DragonFly started tackling some
years ago no become even more and more relevant.


On Mon, Jan 5, 2009 at 11:49 AM, Erik Wikström <Erik-wikstrom@telia.com> wrote:
> It would be interesting to see how much work it would take to compile
> the kernel with g++ instead, after all most valid C is also valid (and
> semantically equal) C++.

Most valid C is valid C++, yes. But there's a difference between valid
and how it's meant.
E.g. consts and other things in C++ are explicitely meant to get rid
of the precompiler mess. (Yes, you may love or hate the precompiler of
course).
If you're seriously doing C++, you would really do some things
different, even though indeed most C code compiles with a C++
compiler.
In most kernels, hardware dependencies are abstracted out with a lot
of help of the precompiler. This shows its great power, but also in
some cases (not specifically talking about DragonFly here :-)) to
unreadable and therefore crappy code. Maybe you can do it different, I
don't know.

But hey, better to keep it 'pure' C if it is C now :-)


cheers,
Pieter



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]