From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 11 22:46:29 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2102716A4DE for ; Tue, 11 Jul 2006 22:46:29 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (megan.kiwi-computer.com [63.224.10.3]) by mx1.FreeBSD.org (Postfix) with SMTP id 731FC43D45 for ; Tue, 11 Jul 2006 22:46:28 +0000 (GMT) (envelope-from rick@kiwi-computer.com) Received: (qmail 93403 invoked by uid 2001); 11 Jul 2006 22:46:27 -0000 Date: Tue, 11 Jul 2006 17:46:27 -0500 From: "Rick C. Petty" To: mag@intron.ac Message-ID: <20060711224627.GA93273@megan.kiwi-computer.com> References: <44B2AE69.4080703@elischer.org> <44B2D2DF.2000401@sh.cvut.cz> <86sll8zl9x.fsf@xps.des.no> <86fyh8zgw8.fsf@xps.des.no> <868xn0z8w9.fsf@xps.des.no> <20060711152949.GB1463@merlin.emma.line.org> <1152642474.29859@origin.intron.ac> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1152642474.29859@origin.intron.ac> User-Agent: Mutt/1.4.2.1i Cc: freebsd-hackers@freebsd.org Subject: Re: kern/99979: Get Ready for Kernel Module in C++ X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jul 2006 22:46:29 -0000 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