From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Peter Crosthwaite <crosthwaite.peter@gmail.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [RFC] [tcg] Idea on refactoring target code generation loop (gen_intermediate_code)
Date: Fri, 8 Apr 2016 16:14:24 +0200 [thread overview]
Message-ID: <5707BCC0.5010504@redhat.com> (raw)
In-Reply-To: <87bn5ktf6w.fsf@dusky.pond.sub.org>
On 08/04/2016 15:15, Markus Armbruster wrote:
> > On the other hand, minimal usage of templates instead of some of the
> > preprocessor gunk we have would be a very good thing IMNSHO. I am
> > referring to the multiply included header files and to the macros with
> > type arguments (mostly QOM casts).
> >
> > I don't think we need more C++ than that, but using templates as
> > basically a type-safe preprocessor would improve QEMU a little bit.
> > More rarely, lambdas could replace some preprocessor magic too, but
> > that's C11 and not many compilers support them.
> >
> > But I won't weep if people say no because we have a lot other
> > low-hanging fruit to make QEMU better (especially the header file
>
> "No!" (Hey, you asked for it)
>
> Back to serious. As Peter Maydell said, "if we move away from C I'd
> rather it to be a language that's nicer than C rather than one that's
> uglier and larger and still retains all of C's flaws."
Sure, except that one plan is feasible now and can be done in small
steps; the other is not feasible now (for example Rust is not even
packaged in Fedora) and entails pretty much a rewrite of the whole code
base.
> People sometimes propose to defang C++ by subsetting and/or coding
> conventions. I'll take that seriously when I see the tool that
> rigorously checks adherence to subset / convention.
The problem with subsetting and conventions is that they always come
with exceptions, besides the fact that no one writes the tool.
So I prefer common sense :) and common sense says that a million-line
codebase that mixes procedural, home-grown OO and language OO is going
to stink from ten miles. And maintainers sit at most two feet from the
screen.
Really even just -Wc++-compat would be a nice improvement so we enjoy a
little more type safety. IMHO, C++'s biggest tax is that Coccinelle
does not like it.
> > cleanups that Markus started and I want to conclude very early in 2.7).
>
> Speaking of which: the plan was you post yours for 2.7, and then I can
> build on top (assuming there's useful work left), right?
I have rebased my stuff already, but I'm going to disappear in about a
week and for the first week or two after the 2.6 release (depending on
whether it slips or not). Also, I will travel most of next week. So I
either I'll post it soonish or it will have to wait a little.
Anyhow, there's definitely useful work left from your last two patches,
even more so after Veronia Bahaa cleaned up qemu-common.h substantially
so there may be more pointless inclusions of it and fewer headers that
really need it.
Paolo
next prev parent reply other threads:[~2016-04-08 14:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 14:38 [Qemu-devel] [RFC] [tcg] Idea on refactoring target code generation loop (gen_intermediate_code) Lluís Vilanova
2016-03-09 15:52 ` Richard Henderson
2016-03-09 18:16 ` Lluís Vilanova
2016-03-09 18:54 ` Richard Henderson
2016-03-09 22:29 ` Lluís Vilanova
2016-03-09 23:27 ` Peter Maydell
2016-03-13 13:16 ` Lluís Vilanova
2016-03-13 16:25 ` Peter Maydell
2016-03-14 7:06 ` Markus Armbruster
2016-03-14 11:13 ` Lluís Vilanova
2016-04-03 13:05 ` Lluís Vilanova
2016-04-07 14:27 ` Markus Armbruster
2016-04-07 14:49 ` Peter Maydell
2016-04-07 15:01 ` Paolo Bonzini
2016-04-08 13:15 ` Markus Armbruster
2016-04-08 14:14 ` Paolo Bonzini [this message]
2016-04-11 5:50 ` Claudio Fontana
2016-04-11 13:11 ` Lluís Vilanova
2016-03-14 12:23 ` KONRAD Frederic
2016-03-14 14:14 ` Paolo Bonzini
2016-03-14 14:26 ` Lluís Vilanova
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=5707BCC0.5010504@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=crosthwaite.peter@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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;
as well as URLs for NNTP newsgroup(s).