Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jul 2006 17:46:27 -0500
From:      "Rick C. Petty" <rick-freebsd@kiwi-computer.com>
To:        mag@intron.ac
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: kern/99979: Get Ready for Kernel Module in C++
Message-ID:  <20060711224627.GA93273@megan.kiwi-computer.com>
In-Reply-To: <1152642474.29859@origin.intron.ac>
References:  <44B2AE69.4080703@elischer.org> <44B2D2DF.2000401@sh.cvut.cz> <86sll8zl9x.fsf@xps.des.no> <courier.44B35DBC.00003F75@intron.ac> <86fyh8zgw8.fsf@xps.des.no> <courier.44B37714.00004B4D@intron.ac> <868xn0z8w9.fsf@xps.des.no> <courier.44B3B9A0.0000609C@intron.ac> <20060711152949.GB1463@merlin.emma.line.org> <1152642474.29859@origin.intron.ac>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jul 12, 2006 at 02:25:21AM +0800, mag@intron.ac wrote:
> 
> Matthias Andree wrote:
> 
> Why would people write Windows application with rather MFC/ATL/.NET
> Framework than direct Windows API?

Because they like buggy code?  (Not that the basic API is much better)

> Why is gtkmm created for GTK+?

Because they enjoy extremely long compile times?  And they like wrappers
around wrappers around wrappers?

> Would you write a X11 application with original X11 API, without QT or
> other X11 toolkits?

Comparing KDE/Qt to GNOME/GTK+ is comparing C++ to C.  I personally prefer
the GTK API (GDK is quite similar to the X11 API) over Qt.  My preference
is mostly due to the overhead and complexity of C++.  C++ and Java are
great for Applications, not as much so for kernels.  I don't mean to drag
this into a KDE vs. GNOME flame war.

Also this is not a fair comparison because these toolkits augment what X11
provides, much like how userland augments a kernel.  Write the front-end in
whatever language/toolkit you prefer; you're still calling Xlib to pass
packets to/from the X server.

> Good packages for various APIs are much easier to learn/debug than those
> original APIs.

What makes you say that C++ would provide a good API?  I think perhaps the
problem may be that the current kernel APIs in C are insufficient...  but
introducing the complexity of C++ both from a language perspective and
from a standard library perspective seems silly to me.  When on the device
driver level, I would rather know precisely when my code is being called
and manage my own memory, etc. and other nitty-gritty details.

I agree that a good API is crucial!  But I also believe that C provides
this better than others.  You can always write code in C++ which calls C
functions, but the converse is quite tricky.

-- Rick C. Petty



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060711224627.GA93273>