From owner-freebsd-questions Wed Apr 11 12:36:34 2001 Delivered-To: freebsd-questions@freebsd.org Received: from femail9.sdc1.sfba.home.com (femail9.sdc1.sfba.home.com [24.0.95.89]) by hub.freebsd.org (Postfix) with ESMTP id 2E59737B423 for ; Wed, 11 Apr 2001 12:36:32 -0700 (PDT) (envelope-from graywane@home.com) Received: from cg392862-a.adubn1.nj.home.com ([65.2.79.221]) by femail9.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with ESMTP id <20010411193631.PNCF146.femail9.sdc1.sfba.home.com@cg392862-a.adubn1.nj.home.com> for ; Wed, 11 Apr 2001 12:36:31 -0700 Received: (from graywane@localhost) by cg392862-a.adubn1.nj.home.com (8.11.3/8.11.3) id f3BJaU605279 for freebsd-questions@FreeBSD.ORG; Wed, 11 Apr 2001 15:36:30 -0400 (EDT) (envelope-from graywane) Date: Wed, 11 Apr 2001 15:36:30 -0400 From: Graywane To: freebsd-questions@FreeBSD.ORG Subject: Re: _Can I use C++ to write device drivers? Message-ID: <20010411153630.A5200@home.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from burnscharlesn@hotmail.com on Wed, Apr 11, 2001 at 11:30:51AM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Apr 11, 2001 at 11:30:51AM -0700, Charles Burns wrote: > (Pre-note. I am not a driver expert by any means) Neither am I :) > You can write a driver for FreeBSD in any language that can compile, i.e., > any non-interpreted language. C++ may not be the best choice for a driver > because it has slightly higher overhead in some cases than C, and many of > its advantages probably wouldn't be very useful in writing drivers. Most of the C++ bloat comes from templates. C++ code without any templates is comparable in size and execution speed to C code. So as long as you don't use templates (which basically means avoid the entire standard C++ library) then C++ would be a fine language for kernel module development. Of course, ISO 9899-1999 fixed the two most annoying C problems -- declaring variables only at the start of a block and no // comments. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message