From owner-freebsd-arch@FreeBSD.ORG Tue Oct 30 22:26:30 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 B43DA16A49C for ; Tue, 30 Oct 2007 22:26:30 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.185]) by mx1.freebsd.org (Postfix) with ESMTP id 5E23013C4BF for ; Tue, 30 Oct 2007 22:26:27 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so1775152rvb for ; Tue, 30 Oct 2007 15:26:15 -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=aFcuwwBUzvZLE66LOXilyy0MHH2ILdnP+/RV31OMoPQ=; b=AuP/2eDVGeb6Iw9qyAmOhUQ4Sg6aNGt9nF5idSouldhHJ7o0GoTeGebWGAZLTArkI6uGlJDQX5g7XJDH/eMWOULlOp+U3bLb01wkgBgVLQTKK6ccPqZmJMy5bP96WgRvXrRkpkYRVIK5Yki+jb4VvrNIK/pKbnDfDPDZqh/0glY= 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=b2kkepNrHD7xUJJR2Uy/aBe+rg3/en3P2qZGpNsmheTaAWJvxBEHHsCoyonh31dA4IYaPpIurRvK3ZqbkMfD9+RvIaxlpRuLoz/ykCE+jVGO8HABlV1LBvk7TSnS6/EmQ4OX2p3Z2IabwmPGiZHly03YyNbUPmuWjTMDhDfRySg= Received: by 10.141.79.12 with SMTP id g12mr3620975rvl.1193782790498; Tue, 30 Oct 2007 15:19:50 -0700 (PDT) Received: by 10.141.194.16 with HTTP; Tue, 30 Oct 2007 15:19:50 -0700 (PDT) Message-ID: <9bbcef730710301519p2931006aq5ba3a94fa1cc67c5@mail.gmail.com> Date: Tue, 30 Oct 2007 23:19:50 +0100 From: "Ivan Voras" Sender: ivoras@gmail.com To: "Poul-Henning Kamp" In-Reply-To: <2979.1193779624@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9bbcef730710300648s4a4162a9x25e5a092111eaab9@mail.gmail.com> <2979.1193779624@critter.freebsd.dk> X-Google-Sender-Auth: a2ec1bac3f02b175 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 22:26:30 -0000 On 30/10/2007, Poul-Henning Kamp wrote: > In message <9bbcef730710300648s4a4162a9x25e5a092111eaab9@mail.gmail.com>, "Ivan > Voras" writes: > >I think the context of my quote was in favour of this, as long as the > >language remains standard. > > But then again, what exactly is "standard" in this context ? > > C99 ? or style(9) ? > > We already use a C-diallect, all I'm proposing is giving it more > theeth so it can help us. Maybe I can better explain my thoughts and what I mean by "ugly" by giving an example. This: SLIST_FOREACH(a,b,c) { } is ugly (one of the reasons is that you need to pass the linkage field name all the time). This: for x in list { } is not. (Yes, the last one looks like a bastard offspring of C and Python, but it's a coincidence). Tree macros are worse, among other things for the fact that you constantly need to pass the type name as an argument. I'm not trying to insult the authors and users of these macros - they are both convenient and powerful, but you can only go so far with macros and preprocessor magic before the whole things starts to sprout mental spikes. I.e. I'd like something like that to be done right - if a different language is really needed, than accept a different language (not butcher C into obedience) as long as it's well defined and used by more than a dozen people on the Earth. Re: C++: This: for (vector::iterator it = v.begin(); it != v.end(); ++it) still looks pretty ugly but at least it's known to almost any CS/IT undergrad out there. My personal choice of a "C++ done right" language is D, it has this variant: foreach(i, a; args) writefln("args[%d] = '%s'", i, a);