Received: from eggs.gnu.org ([208.118.235.92]:46600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfLpI-0006G1-KP for qemu-devel@nongnu.org; Fri, 04 Jan 2019 04:31:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfLpE-0002W4-Mx for qemu-devel@nongnu.org; Fri, 04 Jan 2019 04:31:36 -0500 From: Alberto Garcia In-Reply-To: <3797d82c-a6a6-eb97-be0c-67316ee55e22@redhat.com> References: <20190102110804.18155-1-lbloch@janustech.com> <20190102110804.18155-2-lbloch@janustech.com> <9df1a9a8-284b-573b-98aa-fd77edb0cd65@janustech.com> <1ab08459-6635-acc2-0ba2-961c7a0e5704@redhat.com> <472c0a97-283b-ac81-c07d-11843edd2488@janustech.com> <3797d82c-a6a6-eb97-be0c-67316ee55e22@redhat.com> Date: Fri, 04 Jan 2019 10:31:11 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/1] include: Auto-generate the sizes lookup table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Leonid Bloch , "qemu-devel@nongnu.org" Cc: Kevin Wolf , "qemu-block@nongnu.org" , Stefan Weil , Markus Armbruster , Max Reitz , Philippe =?utf-8?Q?Ma?= =?utf-8?Q?thieu-Daud=C3=A9?= On Thu 03 Jan 2019 10:42:30 PM CET, Eric Blake wrote: > In my view, code generators make sense when used on code that is > expected to change over time (a good example is QAPI because we add > new commands every release; other places might be a generator to help > deal with syscall handlers since newer kernels can add a syscall; or > even the fact that we have used some powerful GNU make textual > processing to make it easy to add files to particular subsets of the > build with as few lines edited as possible), where the goal is that > the generator gives you both a compact representation that is easier > to edit, and that the expansion from the generator ensures that > repetitive boilerplate is formed without typos. In short, if a > generator results in a net reduction in lines of edited source in > relation to the lines it produces, AND if the source that gets > regenerated is likely to change, then it makes total sense to spend > time on the generator. But when the amount of effort to write a > generator costs as much as just hard-coding the list outright, > especially when the list is not going to change (there really aren't > any other powers of 2 within 64 bits), I'm not sure a generator adds > any value. I agree with Eric. Berto