From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 314 invoked by alias); 30 Jul 2008 07:18:51 -0000 Received: (qmail 32763 invoked by uid 22791); 30 Jul 2008 07:18:50 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Jul 2008 07:18:30 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KO5x3-0006tG-SU for gdb@sources.redhat.com; Wed, 30 Jul 2008 07:18:26 +0000 Received: from 78.158.192.230 ([78.158.192.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jul 2008 07:18:25 +0000 Received: from vladimir by 78.158.192.230 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Jul 2008 07:18:25 +0000 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: Move GDB to C++ ? Date: Wed, 30 Jul 2008 09:25:00 -0000 Message-ID: References: <487658F7.1090508@earthlink.net> <200807101901.m6AJ1UMQ007185@brahms.sibelius.xs4all.nl> <488F4AA7.7060001@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 X-IsSubscribed: yes 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: 2008-07/txt/msg00315.txt.bz2 Eli Zaretskii wrote: >> From: Vladimir Prus >> Date: Tue, 29 Jul 2008 21:28:05 +0400 >> >> 1. GDB is made compiled with C++ compiler, with resulting errors removed. >> 2. I refactor struct value, and folks get to comment if the resulting code >> is better, or worse, than what we have. >> >> Comments? > > My only comment is a question: what for? I simply don't see the > intended purpose or the goal of this. > > I happen to manage software projects for a living, and whenever we > need to upgrade or change some of our tools, it is always because we > need to do something that is impossible or very inconvenient with the > existing ones. We never do it out of some abstract wish of "improving > the design" or "refactoring" for their own sake. > > So will someone please tell, loud and clear: what do we want to do the > day after GDB is rewritten in C++? Let's suppose that we magically > fast-forward to the day after everything was refactored and GDB is > 110% pure, OO, C++ -- what will we do the next day that we cannot or > have difficulties doing today? As you surely know, most languages are Turing-complete, so you can do everything in any language, including assembler. The goal, purely, is to spend less time fighting with the language, and more time doing useful things. > Unless we can answer this question, refactoring and rewriting is > simply waste of resources, nothing less, nothing more. And here, you also surely know what is generally goal of refactoring -- to make code simpler and more amendable for future change. This naturally means that you need either some immediate change to make, or general idea what will block many future changes. I do think that struct value needs refactoring -- because I know that adding new kind of value was a pain in current codebase. I do think that target stack needs cleanup, because we ran in some inconveniences during non-stop work, and because multi-process work will have to change it seriously. Those areas do need to be refactored to be hackable-on, and such refactoring better make use of a language suited for OOP -- which those areas try to approximate using C, now. - Volodya