From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb@sources.redhat.com
Subject: Re: Move GDB to C++ ?
Date: Sat, 02 Aug 2008 09:22:00 -0000 [thread overview]
Message-ID: <g718vv$5hf$1@ger.gmane.org> (raw)
In-Reply-To: <u3alnn8o2.fsf@gnu.org>
Eli Zaretskii wrote:
>> Do you agree that if no GDB developer or use can name any issue with C++
>> that will cause him problem, or make him less productive, then it's OK to switch?
>
> No, I don't agree. A good decision has nothing to do with problems
> caused to the developers individually.
Why? I assume that if C++ switch comes with *no problems* at all, it would
not be an issue worth discussing at all. And if it causes some potential
problems, then those problems are for either developers or users. I fail to
see how a problem that does not affect nobody is a "problem".
>> No, I don't think wholesale conversion to C++ is proposed.
>
> How can a program such as GDB be converted to C++ in parts? Can you
> show a practical plan of doing that? Apart of making C code
> compatible with a C++ compiler, the rest should be done at once, or
> else we will have a terrible mess of C++ and C that is actually worse
> of what we have today.
No, we already have a terrible mess of using either macros, or function
pointers, or wrapper functions to emulate classes. At no point during
gradual transition of those mechanisms the code will be worse than it is now.
> And what about new contributions--won't they
> also be requested to be written in C++?
Presumably, for the cases where code in question is converted to C++, and adding
new code requires using C++ features -- yes. For example, if struct value becomes
a class with virtual methods, then naturally one would have to use C++ features
when adding a new method. For other cases, I don't even see how we can request
folks to use C++ -- "you shalt use at least one C++ feature in each patch"? That's
neither possible nor desirable.
>> Do you agree that if no maintainer will say he's less productive in
>> C++ than in C, then we can trust them, and no productivity loss will
>> result?
>
> No.
Do you think that either:
- some developers are not capable of estimating if they personally will
be less productive in C++
- there's some other productivity metric other then sum of individual
productivity for each developer?
>> > Mark was the only one who said why from his POV the switch is
>> > unacceptable. I'm saying something else: a decision like that, if it
>> > needs to be a good decision, should find good arguments _for_ the
>> > change, not only lack of arguments _against_ it. In other words, to
>> > me, "why not?" is not a good argument for significant changes such as
>> > this one.
>>
>> As we've already established, quite a number of people will be more productive
>> in C++, which I think is sufficient "pro" to start more detailed process of
>> collecting pros and cons. You, on the other side, want some stronger "pro"
>> before even trying to list cons. Why?
>
> Again, I already explained why elsewhere: Each change of development
> environment has a non-trivial overhead. To justify that overhead, a
> set of specific development goals should be stated, and then an
> analysis should be made whether the way to reach those specific goals
> will be easier by first changing the environment, and by how much
> easier.
>
> Just improved productivity is not a reason that is good enough,
> because productivity is not a goal in itself, it's a means. For
> example, if no important developments are expected for years to come,
> just maintenance, then productivity is not important.
The approach for reaching a decision that you outline above sounds good,
but it has a problem. There's a big spectrum of approaches. On one side,
one can say that C++ is better that C for all purposes, and claim this
is valid. On the other hand, one can port GDB to C++, and then have
10 equally skilled programmers implement, individually, multi-process
support. 5 would do that in C version, 5 would do that in C++ version,
and then you'd compare code size, number of bugs, and time spent. Neither
of those extreme approaches seems reasonable to *me* -- but any person
has different opinion of what is reasonable enough. I might find that
the need to implement multi-process support is concrete goal, and that
necessary refactorings of target stack is enough motivation for C++,
and somebody else would argue that a complete implementation in C is
first needed. There's no universal agreement, so we'll be back to square
one -- with everybody having his personal opinion on whether the presented
arguments are good enough.
In in commercial setting, if you are the boss, you get to decide which
level of up-front design or prototyping is sufficient. In GDB, there's
no single boss, so we get back to opinions of individuals. If we can't get
an agreement on whether C++ is desired, do you think we can get an agreement
on what decision making process to use?
So my conclusion we're back to individual opinions to the matter. Each person
can be either for the change now, or against the change, or ask for additional
information, which brings me to...
>> You are right that having the concrete code would help. But, did not I already
>> suggested to prepare a patch showing use of C++ for some specific area? Or
>> you suggest to convert every single file to C++ idioms before any kind of further
>> discussion? Naturally, there's certain number of changed lines after which merges
>> between two codebases will become too hard, so we'll have a fork as result. I don't
>> think anybody in this thread wants that to happen, so maybe a local patch for
>> some part of GDB, or several patches, is a better way to evaluate effects of C++?
>
> I've been suggesting this since the beginning: let's have specific
> examples of non-trivial parts of GDB that will show how C++ is better
> than C, both for maintenance of existing code and for future
> development.
...your personal opinion. Am I right that now you are undecided?
What part of GDB do you want to be converted, as example, and what are your criteria for deciding if
C++ version is better than the C one?
- Volodya
next prev parent reply other threads:[~2008-08-02 9:22 UTC|newest]
Thread overview: 128+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-10 18:46 Stan Shebs
2008-07-10 19:01 ` Mark Kettenis
2008-07-10 20:01 ` Stan Shebs
2008-07-10 20:04 ` Paul Koning
2008-07-10 20:40 ` Andrew Cagney
2008-07-10 21:31 ` Stan Shebs
2008-07-10 22:30 ` Nick Roberts
2008-07-10 23:49 ` Stan Shebs
2008-07-11 6:14 ` Vladimir Prus
2008-07-11 12:40 ` Andrew Cagney
2008-07-11 12:23 ` Robert Dewar
2008-07-11 16:03 ` Dave Korn
2008-07-10 21:54 ` Mark Kettenis
2008-07-11 6:26 ` Joel Brobecker
2008-07-11 8:55 ` Vladimir Prus
2008-07-11 9:23 ` Andreas Schwab
2008-07-11 9:32 ` Vladimir Prus
2008-07-11 14:27 ` Andrew Cagney
2008-07-11 14:34 ` Daniel Jacobowitz
2008-07-11 14:54 ` Paul Koning
2008-07-11 15:30 ` Pedro Alves
2008-07-11 16:09 ` Dave Korn
2008-07-11 16:26 ` Daniel Jacobowitz
2008-07-12 5:41 ` Robert Dewar
2008-07-29 17:29 ` Andrew Cagney
2008-07-29 18:08 ` Vladimir Prus
2008-07-29 18:09 ` Thiago Jung Bauermann
2008-07-29 19:05 ` Andrew Cagney
2008-07-29 19:06 ` Thiago Jung Bauermann
2008-07-29 19:35 ` Thiago Jung Bauermann
2008-07-30 7:18 ` Vladimir Prus
2008-07-30 12:11 ` André Pönitz
2008-07-30 12:35 ` Mark Kettenis
2008-07-30 15:39 ` André Pönitz
2008-07-30 17:52 ` Eli Zaretskii
2008-07-30 17:47 ` Eli Zaretskii
2008-07-29 19:32 ` Eli Zaretskii
2008-07-29 19:45 ` Stan Shebs
2008-07-30 18:18 ` Eli Zaretskii
2008-07-30 19:05 ` Stan Shebs
2008-07-30 19:15 ` Eli Zaretskii
2008-07-30 19:42 ` Stan Shebs
2008-07-31 15:37 ` Andrew Cagney
2008-07-30 19:30 ` Andrew Cagney
2008-07-30 19:56 ` Mark Kettenis
2008-07-31 9:03 ` André Pönitz
2008-07-31 9:33 ` Alpár Jüttner
2008-07-31 10:07 ` Alpár Jüttner
2008-07-30 5:24 ` Tom Tromey
2008-07-30 18:30 ` Eli Zaretskii
2008-07-30 20:29 ` David Carlton
2008-07-30 20:30 ` Eli Zaretskii
2008-07-30 20:38 ` Eli Zaretskii
2008-07-31 4:52 ` Michael Veksler
2008-07-31 20:03 ` Ian Lance Taylor
2008-07-30 9:25 ` Vladimir Prus
2008-07-30 11:55 ` Salvatore Lionetti
2008-07-30 18:45 ` Eli Zaretskii
2008-07-30 19:19 ` Stan Shebs
2008-07-29 23:59 ` Mark Kettenis
2008-07-10 19:35 ` Jan Kratochvil
2008-07-10 22:41 ` Tom Tromey
2008-07-11 9:57 ` Andrew STUBBS
2008-07-11 11:44 ` Daniel Jacobowitz
2008-07-11 12:43 ` Pierre Muller
2008-07-11 13:14 ` Andrew Cagney
2008-07-13 23:18 ` Tom Tromey
2008-07-14 0:15 ` Nick Roberts
2008-07-14 8:49 ` Vladimir Prus
2008-07-14 13:21 ` Robert Dewar
2008-07-14 15:54 ` Vladimir Prus
2008-07-14 15:58 ` Robert Dewar
2008-07-14 16:03 ` Robert Dewar
2008-07-14 16:23 ` Vladimir Prus
2008-07-14 16:39 ` Robert Dewar
2008-07-14 17:53 ` Vladimir Prus
2008-07-16 19:06 ` Thiago Jung Bauermann
2008-07-14 17:54 ` Mark Kettenis
2008-07-14 16:12 ` Daniel Jacobowitz
2008-07-14 16:15 ` Robert Dewar
2008-07-14 16:18 ` Robert Dewar
2008-07-14 16:21 ` Bob Rossi
2008-07-14 16:31 ` Vladimir Prus
2008-07-14 19:00 ` Tom Tromey
2008-07-12 3:30 ` Michael Snyder
2008-07-14 14:54 ` Andrew Cagney
2008-07-20 14:36 ` Michael Eager
2008-07-31 8:40 ` Vladimir Prus
2008-07-31 14:37 ` Alpár Jüttner
2008-07-31 22:30 ` GDB to C++ issue: deletion Paul Hilfinger
2008-07-31 22:40 ` Daniel Jacobowitz
2008-07-31 22:58 ` Paul Hilfinger
2008-07-31 23:25 ` Daniel Jacobowitz
2008-08-01 5:38 ` Ian Lance Taylor
2008-08-01 8:52 ` André Pönitz
2008-08-01 9:53 ` Eli Zaretskii
2008-08-01 12:57 ` Daniel Jacobowitz
2008-08-01 14:57 ` Paul Koning
2008-08-01 15:31 ` Eli Zaretskii
2008-08-01 13:51 ` André Pönitz
[not found] ` <20080801125124.GA13594@caradoc.them.org>
[not found] ` <uzlnwn9jq.fsf@gnu.org>
2008-08-01 13:59 ` Daniel Jacobowitz
2008-08-01 15:17 ` Eli Zaretskii
2008-08-01 15:29 ` Daniel Jacobowitz
2008-08-01 15:38 ` Eli Zaretskii
2008-08-12 14:40 ` Problem with can_use_hw_breakpoint Jeremy Bennett
2008-08-12 14:51 ` Eli Zaretskii
2008-08-12 14:56 ` Jeremy Bennett
2008-07-31 20:00 ` Move GDB to C++ ? Eli Zaretskii
2008-08-01 13:13 ` Daniel Jacobowitz
2008-08-01 13:47 ` Eli Zaretskii
2008-08-01 14:04 ` André Pönitz
2008-08-01 15:20 ` Eli Zaretskii
2008-08-04 9:34 ` André Pönitz
2008-08-01 14:21 ` Daniel Jacobowitz
2008-08-01 15:23 ` Eli Zaretskii
2008-08-01 16:14 ` Vladimir Prus
2008-08-01 19:20 ` Eli Zaretskii
2008-08-02 5:55 ` Vladimir Prus
2008-08-02 8:07 ` Eli Zaretskii
2008-08-02 9:22 ` Vladimir Prus [this message]
2008-08-02 9:47 ` Eli Zaretskii
2008-08-02 10:00 ` Vladimir Prus
2008-08-02 10:16 ` Eli Zaretskii
2008-08-01 13:55 ` Mark Kettenis
2008-08-01 14:11 ` André Pönitz
2008-08-01 15:02 ` Stan Shebs
2008-08-01 15:05 ` Vladimir Prus
2008-08-01 15:17 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='g718vv$5hf$1@ger.gmane.org' \
--to=vladimir@codesourcery.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox