From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=50280 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Phn0S-0006lw-Sj for qemu-devel@nongnu.org; Tue, 25 Jan 2011 12:48:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Phn0R-0005mD-AP for qemu-devel@nongnu.org; Tue, 25 Jan 2011 12:48:40 -0500 Received: from mail-gw0-f45.google.com ([74.125.83.45]:43463) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Phn0R-0005m9-37 for qemu-devel@nongnu.org; Tue, 25 Jan 2011 12:48:39 -0500 Received: by gwaa12 with SMTP id a12so2061808gwa.4 for ; Tue, 25 Jan 2011 09:48:38 -0800 (PST) Message-ID: <4D3F0CF3.1020101@codemonkey.ws> Date: Tue, 25 Jan 2011 11:48:35 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC 0/7] Introduce hard dependency on glib References: <1295902845-29807-1-git-send-email-aliguori@us.ibm.com> <4D3EB94E.3080406@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: Anthony Liguori , Stefan Hajnoczi , Marcelo Tosatti , "qemu-devel@nongnu.org" , Gerd Hoffmann , Paulo Bonzini , Arun Bharadwaj , Paul Brook On 01/25/2011 08:48 AM, Stefano Stabellini wrote: > On Tue, 25 Jan 2011, Gerd Hoffmann wrote: > >>> I've spent the past few months working on C++ integration for QEMU. I'm more >>> convinced than ever that we desperately in need of structured object oriented >>> mechanisms to be successful but am pretty strongly convinced that incremental >>> additional of C++ is not going to be successful. >>> >> Agree. I doubt switching to C++ will fly. But using glib has pretty >> good chances to be a big success long-term. >> >> > Why is everyone so pessimistic on switching to C++? > > Anthony: considering that you have direct experience on trying to do > this, why are you convinced it is not going to work? > I'm not ruling out C++ altogether but at this stage, I can't see an incremental transition to C++ working all that well. I tried to isolate the device models and have a well defined interface between the C and C++ code but the trouble is that if you want the C++ side of things to be Good C++ code, you end up having to replace large chunks of QEMU code. It's possible that I just took the wrong approach. My end goal is not C++, it's to improve the device model. I haven't tried doing it with GObject yet but before we even get there, there's a lot of good we can do with glib. Regards, Anthony Liguori > I am asking because I have always found the glib GObject stuff a little > ugly compared to well written C++ code (of course you can write ugly > code in any language if you want to). >