From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 12 14:48:33 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 AE16316A4DA for ; Wed, 12 Jul 2006 14:48:33 +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 15B5043D46 for ; Wed, 12 Jul 2006 14:48:28 +0000 (GMT) (envelope-from rick@kiwi-computer.com) Received: (qmail 99502 invoked by uid 2001); 12 Jul 2006 14:48:27 -0000 Date: Wed, 12 Jul 2006 09:48:27 -0500 From: "Rick C. Petty" To: pfgshield-freebsd@yahoo.com Message-ID: <20060712144827.GA99296@megan.kiwi-computer.com> References: <20060712090019.GA723@turion.vk2pj.dyndns.org> <20060712141029.35239.qmail@web32707.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060712141029.35239.qmail@web32707.mail.mud.yahoo.com> 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: Wed, 12 Jul 2006 14:48:33 -0000 On Wed, Jul 12, 2006 at 04:10:29PM +0200, pfgshield-freebsd@yahoo.com wrote: > > C++ is the de-facto standard for OO That is just sad. So many other languages do a much better job of implementing OO (Smalltalk, Java, Python, even Scheme). While we're at it, why not implement a bytecode interpreter for all of these languages into the kernel? That would be sweet.. I'm being facetious here; OO has some merit but aside from that, there's very little utility an additional language can provide. Granted, it's easier (read: lazier) to use: try { ... } catch (...) ... than it is to do: error = some_fn_which_could_error(); if (error) return error; ... While I haven't looked at kobj, I have seen some good implementations of OO in plain C (GTK's gobject comes to mind). I believe at least basic OO framework is available and doesn't require a huge performance hit, as undoubtedly a C++ solution would provide (at least from my experience). For all C++ gives you, I believe the potential is there to do the same things in C. I'm all for making kernel code free of C++ reserved words (although I'd recommend changing "new" to "new_obj", etc. instead of "_new" or similar). This would allow C++ developers to write drivers and such. But I don't feel there is any benefit to commit C++ code into the "pristine" kernel source. Also, I thought the C++ "standard" was still being argued about and thus is incomplete?? (I certainly know there are C-isms which don't appear in any C++ standard as of yet) Not to pick on the gcc/g++ folks, but it's difficult to find a decent C++ compiler which implements all/most of the language standard and also reliably compiles/cross-compiles on various systems. OTOH, gcc does an excellent job! For this reason, BSD shouldn't bend over backwards for C++ developers any more than it should for Python or Ruby developers. The implied stability and consistency of a finished language is exactly what is needed for a stable and consistent OS (kernel). Pick a language (let's call it "C") that isn't likely to evolve any further. Oh wait, we already did :-P -- Rick C. Petty