From owner-freebsd-arch@FreeBSD.ORG Tue Oct 30 13:48:33 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 8A36716A46C for ; Tue, 30 Oct 2007 13:48:33 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by mx1.freebsd.org (Postfix) with ESMTP id 423B013C4AA for ; Tue, 30 Oct 2007 13:48:32 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so1297652nzf for ; Tue, 30 Oct 2007 06:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=GoNS22CxsgniUOMLKGd9Nj5kv70GxrGuQS8rMwIFO+g=; b=ETWyoIcYJwbtjLW3iAYv3rmH0nuMWOAAcacg8ETIT1yOL/Xd91jcg45G2NVZqGSyTrbH5J7uOoJWyhjRl9DbmyUMmeWaaQdxoDQxSBfALjwTY1k05zWtcO/gp5lG8Z0lza5oTw6Iaf/X5imE1CtZoSZajiBXDlHmq/ATnR9Sc2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ps3BuDg2/a4PEMpC7yyUJm2FMRupxelkxReuFhUO7Q5D+dfogjrbcZT+4nkTXXxRyvl6x7Sotpft0zD5a7Zmu86AESYHzrWbeEsta4pGGMOQec/s4bPLtmhBWU2W3Gd6dCgm2O6KFnM4JUlaL6kCvcETrPDEXapdbB3LbPQ3Yd8= Received: by 10.141.87.13 with SMTP id p13mr3333677rvl.1193752111341; Tue, 30 Oct 2007 06:48:31 -0700 (PDT) Received: by 10.141.194.16 with HTTP; Tue, 30 Oct 2007 06:48:26 -0700 (PDT) Message-ID: <9bbcef730710300648s4a4162a9x25e5a092111eaab9@mail.gmail.com> Date: Tue, 30 Oct 2007 14:48:26 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "Peter Jeremy" In-Reply-To: <20071030104554.GZ70883@server.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <33676.1193689342@critter.freebsd.dk> <9bbcef730710291600w607e46d8x8c893aa4e53b597d@mail.gmail.com> <20071030104554.GZ70883@server.vk2pj.dyndns.org> X-Google-Sender-Auth: b2e773ad724ae068 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 13:48:33 -0000 On 30/10/2007, Peter Jeremy wrote: > On Tue, Oct 30, 2007 at 12:00:45AM +0100, Ivan Voras wrote: > >handle those. There is no reason not to implement the kernel in e.g. > >Pascal (if would even give us some of the features you want: string > >and array bounds checking) though C might be more efficient because > >it's closer to the metal. > > Pascal was designed for teaching programming. I don't think it should > be used in any production environment. Some of the design decisions > (eg no logical short-cutting) make writing real code quite painful. > PrimeOS was written in FORTRAN - which I think was stretching the > language rather a lot. Multics was written in PL/I. The Modula > family were designed for systems programming. Of course I'm not suggesting to rewrite the kernel in Pascal (or anything else). > >> 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. > > It depends on what Poul-Henning intends by "dialect". I would also > be concerned about changing the language by adding new keywords or > magic functions that were required to be understood for the code > to function correctly. OTOH, extending (eg) the __attribute__ > syntax to provide optional guidance to the compiler to let it > produce better code and provide better warnings is a good thing - > the code is correct with or without the __attribute__ but the > compiler has a better idea of what the programmer intended. I think the more advanced examples here: http://wiki.freebsd.org/K are sufficiently diverged from C to make them ugly :) > >(even if it means patches to the compiler), > > I see no reason not to patch the compiler if we can make it generate > code and/or warnings that make it easier to locate and/or avoid bugs. I think the context of my quote was in favour of this, as long as the language remains standard. On the other hand, if the goal is to make debugging easier, isn't DTrace going to be "The Way" to do it?