From owner-freebsd-arch@FreeBSD.ORG Tue Oct 30 07:03:55 2007 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD69F16A417; Tue, 30 Oct 2007 07:03:55 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9D913C491; Tue, 30 Oct 2007 07:03:55 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id 5DD2617104; Tue, 30 Oct 2007 07:03:31 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.1/8.14.1) with ESMTP id l9U73Upd035773; Tue, 30 Oct 2007 07:03:30 GMT (envelope-from phk@critter.freebsd.dk) To: "Ivan Voras" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 30 Oct 2007 00:00:45 +0100." <9bbcef730710291600w607e46d8x8c893aa4e53b597d@mail.gmail.com> Date: Tue, 30 Oct 2007 07:03:30 +0000 Message-ID: <35772.1193727810@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: freebsd-arch@freebsd.org Subject: Re: C++ in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2007 07:03:55 -0000 In message <9bbcef730710291600w607e46d8x8c893aa4e53b597d@mail.gmail.com>, "Ivan Voras" writes: >On 29/10/2007, Poul-Henning Kamp wrote: >> For instance, the entire "dual-address space" dictomy og system >> calls/copy{in,out} and the very concept of interrupts are very >> tricky to sensibly express in anything but C. > >I don't see those example as something special or different - they are >just "there" to implement with or around. You don't get my point obviously. I'm not talking about "being able to", I'm talking about "being able to improve the quality of". You're totally right that C++ doesn't help in any way, and that is exactly my point, I want help from the compiler, not hindrance. >> So what I've been tinkering with, is not a new language, but a >> C dialect enhanced to make kernel programming simpler. > >That's my point: another nonstandard dialect of C, no matter how >useful, will only alienate new people from joining the project. A >subset of C++ will not. I suspect that C++ might alienate a number of current developers :-) >>an option to check all function pointers for >> non-null-ness before jumping through them. > >At compile time or at runtime? :) At compile time it's practically >impossible in C, at runtime, the only thing you could reasonably do is >panic, which doesn't gain you anything... A panic gains you a lot, if it happens before the function pointer call hoses you, rather than after, when you cannot get a backtrace. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.