From owner-freebsd-questions@FreeBSD.ORG Tue Apr 20 13:32:07 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CCF416A4CE for ; Tue, 20 Apr 2004 13:32:07 -0700 (PDT) Received: from lilzmailso01.liwest.at (lilzmailso01.liwest.at [212.33.55.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0145343D1F for ; Tue, 20 Apr 2004 13:32:07 -0700 (PDT) (envelope-from dgw@liwest.at) Received: from cm217-96.liwest.at ([81.10.217.96]) by lilzmailso01.liwest.at with esmtp (Exim 4.24) id 1BG1uY-0007uw-7I; Tue, 20 Apr 2004 22:32:06 +0200 From: Daniela To: Kai Grossjohann Date: Tue, 20 Apr 2004 21:27:00 +0000 User-Agent: KMail/1.5.3 References: <200404151110.i3FBAaoo048373@adsl-68-76-19-75.dsl.klmzmi.ameritech.net> <200404162241.56535.dgw@liwest.at> <87y8ouscfq.fsf@emptyhost.emptydomain.de> In-Reply-To: <87y8ouscfq.fsf@emptyhost.emptydomain.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404202127.00007.dgw@liwest.at> cc: freebsd-questions@freebsd.org Subject: Re: Beginning C++ in FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 20:32:07 -0000 On Saturday 17 April 2004 18:10, Kai Grossjohann wrote: > Daniela writes: > > On Friday 16 April 2004 20:31, Kai Grossjohann wrote: > >> Daniela writes: > >> > What? C++ code is converted to C? Which compiler are you using, and > >> > why the hell would a compiler do this? > >> > >> In the old days, C++ was implemented by a program called cfront, I > >> believe, and it did convert C++ to C. > >> > >> If you can write a program that converts language X to C, then you get > >> to take advantage of all the nifty optimizing C compilers out there. > >> If you try to go the direct route to compiling into machine language, > >> then you need to do the optimization part yourself. So converting > >> into C as an intermediary language is an option that requires less > >> work. > > > > There's no harm in doing the optimizing yourself. If you compile > > directly, then you can optimize much more because you can take advantage > > of the structure of the language. Two different languages always have > > different strengths and weak points. > > What I was trying to say is that using C as an intermediary language > reduces effort. Of course it is /possible/ to do the optimizing > yourself, it is just more work. > > I think that "reducing effort" is a pretty damn good reason for doing > something in a specific way. I hope that answers your "why the hell" > question. Yes, I think reducing effort is a good reason, after all that's why I reduce the effort for the processor.