From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmsV7-00060q-1N for qemu-devel@nongnu.org; Mon, 16 Jan 2012 14:45:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmsV5-0000CF-Ri for qemu-devel@nongnu.org; Mon, 16 Jan 2012 14:45:53 -0500 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:37340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmsV5-0000C0-N7 for qemu-devel@nongnu.org; Mon, 16 Jan 2012 14:45:51 -0500 Message-ID: <4F147E6C.1090203@weilnetz.de> Date: Mon, 16 Jan 2012 20:45:48 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1326738174-14771-1-git-send-email-aliguori@us.ibm.com> <4F14794C.5060706@us.ibm.com> In-Reply-To: <4F14794C.5060706@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC] pyembed: integer python into QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, Alex Bradbury Am 16.01.2012 20:23, schrieb Anthony Liguori: > On 01/16/2012 12:35 PM, Alex Bradbury wrote: >> On 16 January 2012 18:22, Anthony Liguori wrote: >>> This is something I started during 1.0-rc on a lark and spent some >>> time last >>> night actually making work. I'm sending it only to show that (1) >>> it's possible >>> and (2) to get some input about what other people think as a longer >>> term >>> direction. >> >> At the risk of starting a language flame-war, have you considered >> embedding something like Lua?The source of the core Lua interpreter is >> small enough that it could be imported into the Qemu repository. > > Generally, I don't think importing external source code is a Good > Idea. Part of the appeal to me about Python is the rich library that > it brings in. > > I'm less interested in Python for it's list comprehension syntax and > more interested in it for it's config parsing library, RPC > infrastructure, etc. > > Plus, I'm reasonably confident that most QEMU developers have some > experience with Python. I'd wager that very few people have any > practical experience with LUA. > > So in terms of embedding, I think Python is the only reasonable path > forward (if we think we should even head in this direction). > 5 years ago, I experimented with an embedded Ruby interpreter. Although it worked (at least to some degree), that's not a reasonable path. Standalone Ruby is a good interpreter language, but embedding a Ruby interpreter is horrible. Embedding TCL works well, but TCL is a little old fashioned, so that's also not a reasonable path. If we need an embedded interpreter, Python is a good choice, but Lua is also an excellent embedded interpreter which would be useful for QEMU. I'd prefer a competition with both of them instead of a single "only reasonable path". The overhead of supporting two interpreters won't be very high, and it will allow more people to contribute scripts in their favorite language. Cheers, Stefan Weil