Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3me5-0006rA-Mh for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 21:42:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m3me3-0000gJ-Gw for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Jul 2021 21:42:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3me3-0000gB-8z for pgsql-hackers@lists.postgresql.org; Wed, 14 Jul 2021 21:42:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m3me0-0005uk-UO for pgsql-hackers@postgresql.org; Wed, 14 Jul 2021 21:42:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 16ELgADa3569907; Wed, 14 Jul 2021 17:42:11 -0400 From: Tom Lane To: Andres Freund cc: Peter Eisentraut , David Rowley , pgsql-hackers Subject: Re: automatically generating node support functions In-reply-to: <20210611192353.ugmjp2txdwp2duls@alap3.anarazel.de> References: <20210611192353.ugmjp2txdwp2duls@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Fri, 11 Jun 2021 12:23:53 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3569905.1626298930.1@sss.pgh.pa.us> Date: Wed, 14 Jul 2021 17:42:10 -0400 Message-ID: <3569906.1626298930@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2021-06-08 19:45:58 +0200, Peter Eisentraut wrote: >> On 08.06.21 15:40, David Rowley wrote: >>> It's almost 2 years ago now, but I'm wondering if you saw what Andres >>> proposed in [1]? >> That project was technologically impressive, but it seemed to have >> significant hurdles to overcome before it can be useful. My proposal is >> usable and useful today. And it doesn't prevent anyone from working on a >> more sophisticated solution. > I think it's short-sighted to further and further go down the path of > parsing "kind of C" without just using a proper C parser. But leaving > that aside, a big part of the promise of the approach in that thread > isn't actually tied to the specific way the type information is > collected: The perl script could output something like the "node type > metadata" I generated in that patchset, and then we don't need the large > amount of generated code and can much more economically add additional > operations handling node types. I think the main reason that the previous patch went nowhere was general resistance to making developers install something as complicated as libclang --- that could be a big lift on non-mainstream platforms. So IMO it's a feature not a bug that Peter's approach just uses a perl script. OTOH, the downstream aspects of your patch did seem appealing. So I'd like to see a merger of the two approaches, using perl for the data extraction and then something like what you'd done. Maybe that's the same thing you're saying. I also see Peter's point that committing what he has here might be a reasonable first step on that road. Getting the data extraction right is a big chunk of the job, and what we do with it afterward could be improved later. regards, tom lane