Date: Wed, 12 Jul 2006 09:48:27 -0500 From: "Rick C. Petty" <rick-freebsd@kiwi-computer.com> To: pfgshield-freebsd@yahoo.com Cc: freebsd-hackers@freebsd.org Subject: Re: kern/99979: Get Ready for Kernel Module in C++ Message-ID: <20060712144827.GA99296@megan.kiwi-computer.com> In-Reply-To: <20060712141029.35239.qmail@web32707.mail.mud.yahoo.com> References: <20060712090019.GA723@turion.vk2pj.dyndns.org> <20060712141029.35239.qmail@web32707.mail.mud.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060712144827.GA99296>