From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32747 invoked by alias); 6 Apr 2012 13:16:39 -0000 Received: (qmail 32732 invoked by uid 22791); 6 Apr 2012 13:16:38 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TO_NO_BRKTS_PCNT X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 Apr 2012 13:16:25 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id F29591C6C47 for ; Fri, 6 Apr 2012 09:16:21 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nOkUw5kn-F59 for ; Fri, 6 Apr 2012 09:16:21 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id BA5C01C69F8 for ; Fri, 6 Apr 2012 09:16:21 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 29A88145616; Fri, 6 Apr 2012 06:16:19 -0700 (PDT) Date: Fri, 06 Apr 2012 13:16:00 -0000 From: Joel Brobecker To: gdb@sourceware.org Subject: Re: Will therefore GDB utilize C++? Not. Message-ID: <20120406131619.GI27438@adacore.com> References: <20120330161403.GA17891@host2.jankratochvil.net> <87aa2rjkb8.fsf@fleche.redhat.com> <201204042155.q34LtJNB013402@glazunov.sibelius.xs4all.nl> <4F7D8603.90801@redhat.com> <201204060034.q360Yo0m007419@new.toad.com> <4F7E4849.1090104@netspace.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F7E4849.1090104@netspace.net.au> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00053.txt.bz2 > >I do not recommend that GDB use C++. > > I agree 100% on all points. I came to the same conclusions 10 years > ago. Everything i do now is C, and i only poke with C++ to grab > something out of it or to reverse engineer. I wish we would stop discussing about the language itself, and argue the technical points that the pro-C++ camp were bringing up. There are a number of issues with GDB's design there were raised, and solutions involving the use of C++ were proposed. As far as I know, the anti-C++ camp has rejected C++ in general based on general and vague arguments, rather than argue the specific points that have been brought up. We are NOT talking about using ALL of C++, we are talking about using a reasonable subset that would allow us to expand a bit what the language can do for us. If the non-discussion continues, we're going to have to make a decision on how to decide on this issue, and I am afraid that the only fair way would be for the Global Maintainers to vote. To my knowledge, we have never resorted to such an extreme approach, but I don't see a real discussion happening here. > Most C++ programmers i've seen have this mentality that they don't > need to know what's "under the hood" such as what some library is > doing or how inefficient it is. Please, we're talking about the GDB Maintainers and the few contributors who actually participate in GDB's development. This argument means nothing because the only side-effect is that such programers would be limited in how much they can contribute. But on the other hand, if we follow your reasoning, they would not be able to contribute anyway, since using C makes the language too low-level for them. I will just go out and say it, but I think about half of the active maintainer, if not more, are in favor of using some features of C++. And I can tell you right here and now that they are no dummies. > OTOH, i don't recommend trying to emulate C++ in plain C, or you end > up with a maintenance disaster like GTK. And yet, that's exactly what we are doing: - unit elaboration; - gdbarch/language dispatching - exception handling - use of unions to emulate polymorphism; - etc, etc, etc. And frankly, you criticize GTK's design, but it was exactly the design I was thinking about of emulating if we wanted a more OO approach without using C++. To my knowledge, KDE is doing very well, and is written in C++. So again, the proposal that was put on the table a long time ago was that some specific features of C++ be used in order to simplify certain areas of GDB's code. The pro-C++ camps has, in my opinion, successfully shown how C++ was going to help. The specific arguments, in my opinion, should be brought up again, and those specific arguments should be discussed, rather than just discussing generalities about how horrible C++ is. > All it requires is a few more short lines of explanatory design > notes scattered through the code and clarity of thought. This is almost offensive. If it was that easy, how about you start sending some patches? -- Joel