From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 12 16:08:04 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 E320916A4EE for ; Wed, 12 Jul 2006 16:08:04 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B15B43D58 for ; Wed, 12 Jul 2006 16:08:01 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (uhktgb@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id k6CG7suB029651; Wed, 12 Jul 2006 18:08:00 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id k6CG7sdG029650; Wed, 12 Jul 2006 18:07:54 +0200 (CEST) (envelope-from olli) Date: Wed, 12 Jul 2006 18:07:54 +0200 (CEST) Message-Id: <200607121607.k6CG7sdG029650@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG, rick-freebsd@kiwi-computer.com In-Reply-To: <20060712144827.GA99296@megan.kiwi-computer.com> X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.0-20051224 ("Ronay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 12 Jul 2006 18:08:00 +0200 (CEST) Cc: 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: freebsd-hackers@FreeBSD.ORG, 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 16:08:05 -0000 Rick C. Petty wrote: > 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). That's true. At OOPSLA '97, Alan Kay (an OO pioneer) said: "I made up the term 'object-oriented', and I can tell you I didn't have C++ in mind." However, none of the languages you mentioned is really well- suited for FreeBSD kernel development. Just for the record, there are a lot of C-like languages that could be used, in theory. For example Objective-C (which has a nice, Smalltalk-like OO implementation, and it is even completely backwards-compatible to C). Another neat language is Cyclone ( http://cyclone.thelanguage.org ), which is intended to be a "safe" dialect of C, because it prevents buffer overflows, dangling pointer accesses etc., and even has modern features such as pattern matching and type inference, and it even borrowed a few things from C++ (it uses gcc as the backend and is easy to interface with standard C code). Note that I do _not_ imply to actually use any of the above mentioned languages for FreeBSD kernel programming. Perso- nally I prefer to stick with plain 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. The biggest problem is that using C++ code in the kernel would reduce the number of potential maintainers signifi- cantly. It would also make debugging more difficult, especially for non-experts who try to submit useful PRs. That's a very important point to consider. Just my 2 cents. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." -- Doug Gwyn